C Programming: Prakash Shantagiri
C Programming: Prakash Shantagiri
Prakash shantagiri
-1-
-2-
-3-
-4-
-5-
float rpu,bill,tax;
clrscr();
puts("\nEnter rate per unit ");
scanf("%f",&rpu);
puts("\nEnter old reading ");
scanf("%d",&oldrd);
puts("\nEnter new reading ");
scanf("%d",&newrd);
diff=newrd-oldrd;
puts("\nEnter the Total TAX ");
scanf("%f",&tax);
bill=(rpu*diff)+tax;
printf("\n\n Number of Units are : %d",diff);
printf("\n\n Rate per Unit is : %f",rpu);
printf("\n\n TAX is
: %f",tax);
printf("\n\n Electric Bill is : %f",bill);
}
-6-
OUTPUT
Enter rate per unit
2.90
Enter old reading
123
Enter new reading
234
Enter the Total TAX
80
-------------------------------Number of Units are : 111
Rate per Unit is
: 2.900000
TAX is
: 80.000000
-------------------------------Electric Bill is : 401.900024
---------------------------------------------OUTPUT
Enter rate per unit
1.75
Enter old reading
456
Enter new reading
987
Enter the Total TAX
80
-------------------------------Number of Units are : 531
Rate per Unit is
: 1.7500000
TAX is
: 80.000000
-------------------------------Electric Bill is : 611.0000
-7-
-8-
OUTPUT
Enter the matrix of 3x3
123456789
Given Matrix :
1 2 3
4 5 6
7 8 9
Addition of diagonal elements of given matrix : 15
-----------------------------------------------------------------------------Enter the matrix of 3x3
147862359
Given Matrix :
1 4 7
8 6 2
3 5 9
Addition of diagonal elements of given matrix : 16
-9-
- 10 -
OUTPUT:
Enter any digits:
4500
7008
1004
7821
6599
Biggest Number is:7821
Smallest Number is:1004
OUTPUT:
Enter any digits:
11
12
13
48
47
Biggest Number is:48
Smallest Number is:11
- 11 -
OUTPUT
Enter the no
3
1
12
123
3
32
321
- 12 -
- 13 -
OUTPUT
Enter number of items
5
Enter rate of each item one by one
20.00
34.50
15.90
25.60
5.50
Enter the discount rate
5.5
Numbers of Items are
:5
Total amount of all items is: 101.500000
Discount Rate is
; 5.500000
Bill amount is
: 95.917503
-----------------------------------------------------Enter number of items
5
Enter rate of each item one by one
120.00
134.50
115.90
125.60
105.50
Enter the discount rate
4.5
Numbers of Items are
:5
Total amount of all items is: 601.500000
Discount Rate is
Bill amount is
;4.500000
: 574.43
- 14 -
- 15 -
OUT PUT:
employees salary
enter name : PAVITRA
enter the basic salary :2500
the total salary is 5250.000000
enter name : ALI
enter the basic salary :4500
the total salary is 9370.000000
enter name : LOKESH
enter the basic salary :3500
the total salary is 7310.000000
enter name : SHIVRAJ
enter the basic salary :4500
the total salary is 9370.000000
enter name : Susma
enter the basic salary :4800
the total salary is 9988.000000
- 16 -