C_Journal_Programming List
C_Journal_Programming List
22 J14 An electric power distribution company charges its domestic consumers as follows:
Consumption Units Rate of Charge
1-100 Rs. 0.75 per unit
101-300 Rs. 75 plus Rs. 1.00 per unit excess of 100
301-500 Rs. 275 plus Rs. 1.50 per unit excess of 300
500 and above Rs. 575 plus Rs. 1.75 per unit excess of 500
Read customer number, name and unit consumed. Calculate and print bill amount.
23 J15 To read employee code, employee name, Basic Salary and LIC.
Calculate DA, HRA, MA, PF, IT and PT according to following criteria.
DA calculation PF calculation
For basic<=5000 then da = 20% of For basic<=5000 then pf= 8% of basic.
basic. For basic<=9000 then pf=12% of basic.
For basic<=9000 then da = 30% of For basic<=15000 then pf=20% of basic.
basic. For 15000<basic then pf=25% of basic
For basic<=15000 then da = 40% of
basic.
For 15000<basic then da= 50% of basic
HRA calculation PT Calculation
code = 0 then hra=0 If Gross Salary <=10000 then PT=200 rs
code=1 then hra=120 rs. If Gross Salary <=20000 then PT=400 rs.
code=2 then hra=250 rs. If Gross Salary >20000 then PT = 500 rs.
code=3 then hra=400 rs.
MA CALCULATION IT Calculation
20% of basic salary 10% of Gross Salary.
Print the pay Slip as follows:
EMPLOYEE PAYSLIP
Employee Code: ___________ Name: ________________
Earnings Amount Deductions Amount
BASIC 99999.99 PF 99999.99
DA 99999.99 LIC 99999.99
HRA 99999.99 IT 99999.99
MA 99999.99 PT 99999.99
Gross Salary 99999.99 Total Deduction 99999.99
Net Salary 99999.99
Assignment – 3 (Loop Based Programs)
24. To print your name on the screen 10 times using while loop.
25. To print your name on the screen 10 times using do while loop.
26. To print your name on the screen 10 times using for loop.
27. J16 To print 1 to n numbers using for loop.
28. J17 To find out the factorial of a given number.
US1MABCA02 || C Practical List
29. To read an integer number and display each digit of it in a separate line in reverse
order.
30. J18 To read an integer number and display it in reverse order.
31. J19 To read any integer number and find out the total number of an odd value digits
and even value digits and also print the sum of all odd value digits and sum of
even value digits.
32. J20 To check whether the number is Palindrome.
33. To check whether the number is Armstrong.
34. To check whether the number is Prime.
35. To print the following series: 1, 2, 3, 4, … Up to N.
36. To print the following series: 1, 3, 5, 7, … Up to N.
37. To print the following series: 2, 4, 6, 8, … Up to N.
38. To print the following series: 1, 4, 9, 16, … Up to N.
39. J21 To print N terms of Fibonacci series.
Input: N=8
Output: Fibonacci series: 0 1 1 2 3 5 8 13
40. To print the following series and find the sum: 1 + 2 + 3 + 4 + 5 + …………up to N.
41. To print the following series and find the sum: 1 + 3 + 5 + 7 + 9 + …………up to N.
42. To print the following series and find the sum: 1 + 4 + 9 + 16 + 25 + ……up to N.
43. To print the following series and find the sum: 1 – 2 + 3 – 4 + 5 – 6 + ……up to N.
44. To print the following pattern for N=4.
*
* *
* * *
* * * *
45. J22 To print the following pattern for N=4.
1
2 2
3 3 3
4 4 4 4
US1MABCA02 || C Practical List