APM Welcome, APM North West Network Conference, Synergies Across Sectors
c language programing
1. 1. WAP to calculate addition of two given values and display result on output screen. [without scanf( )].
2. WAP to calculate average of 5 given float values and display result on output screen. [without scanf( )].
3. WAP to take input for two user-defined values and perform following calculations. [take i/p using scanf( )].
- add=a+b
- sub=a-b
- mul=a*b
- div=a/b
4. WAP to calculate area of circle and circumference of circle according to value of radius given as input.
[Area=3.14*R*R ] [Circumference=2*3.14*R].
5. WAP to calculate area of rectangle and perimeter of rectangle according to value of length & breadth given
as input. [Area=L*B ] [Perimeter=2*(L+B)].
6. WAP to calculate simple interest according to value of principle, rate of interest & no of years given as
input. [SI = (p*r*n)/100].
7. WAP to convert temperature from Celsius to Fahrenheit. [F=(C*1.8)+32]
8. WAP to convert temperature from Fahrenheit to Celsius. [C= (F – 32)/1.8].
9. WAP to calculate volume of cylinder according to radius & height entered as input. [V=3.14*R*R*H].
10. WAP to calculate volume of cube according to value of side entered as input. [V=S*S*S].
11. WAP to swap values of two variables using third variable.
12. WAP to swap values of two variables without using temp.
13. WAP to check whether number entered is even or odd.
14. WAP to find largest number from 2 numbers entered as input.
15. WAP to find smallest from 2 numbers entered as input.
16. WAP to check whether year entered is leap year or not. [The year entered as input should be of four digits].
17. WAP which takes marks of 5 subjects & roll-no as input and calculate total & percentage also print result in
terms of [distinction (>=70) , first-class(>=60 & <=70),second-class(>=50 & <=60),pass-class(>=45 &
<=50) else fail]. [elseif ladder]
18. A cloth showroom has announced the following discounts on purchase of cloth worth Rs as follow:-
If purchase amount if less than 50 customer will not get any discount.
Display amount before discount, discount offered & amount after discount to be paid by customer.
PURCHASE AMOUNT DISCOUNT RATES
51 – 100 5%
101-200 7.5%
201-300 10%
Above 300 15%
19. An electric power distribution company charges its customer as follow:
Take input for customer number & consumption units.
Consumption Units Rates of charge
0-200 Rs. 0.50 per unit
201-400 Rs 100 plus Rs 0.65 per unit excess of 200
401-600 Rs 230 plus Rs 0.80 per unit excess of 400
2. 601 and above Rs 390 plus Rs 1.00 per unit excess of 600
20. WAP to create choice based calculator which takes input for two values and performs calculation for [+,-,*,
/]. [switch case & else if ladder].
21. WAP to check whether number entered is positive, negative or zero.
22. WAP to create choice based converter which takes input for distance in kM and carries conversion to [m,
cm, mm, feet & inch]. [switch case][make use of goto statement]
23. WAP to find largest from 3 numbers entered as input. [elseif ladder & nesting]
24. WAP to find smallest from 3 numbers entered as input.
25. WAP to print series of natural numbers starting for n upto 1. [use for loop].
26. WAP to print series of odd numbers from 1 to n terms.
27. WAP to print series of even numbers from 2 to n terms.
28. WAP to print series of numbers divisible by 7 starting from 7 to n terms. Find sum & count them.
29. WAP to print series 1,4,9,…..n terms
30. WAP to print series 1,11,111,…..n terms
31. WAP to print series 1, 8, 27……n terms.
32. WAP to print series 21, 24,27 …..n terms.
33. WAP to print series 2-4+6-8…..n terms.
34. WAP to print Fibonacci series 1,1,2,3,…n terms
35. WAP to print power of number entered as input.
36. WAP to find factorial of number entered as input.
37. WAP to print following patterns upto n terms.:-
* **** 1 1 1234 4444 1
** *** 12 22 123 333 23
*** ** 123 333 12 22 456
**** * 1234 4444 1 1 78910
4 4321 A A A ABCD DDDD
43 321 AB BB BC ABC CCC
432 21 ABC CCC DEF AB BB
4321 1 ABCD DDDD GHIJ A A
DCBA * **** 1234 4 A 1
DCB ** *** 234 34 BB 1 2 1
DC *** ** 34 234 CCC 1 2 3 2 1
D **** * 4 1234 DDDD 1 2 3 4 3 2 1
A 12321
ABA 121
ABCBA 1
ABCDBCA
38. WAP to find number entered as input is prime or composite.
39. WAP to check number entered as input is ARMSTRONG or not.
40. WAP to check number entered as input is PERFECT number or not.
41. WAP to reverse the number entered as input.
42. WAP to find sum of digits for number entered as input.
43. WAP to check number entered as input is palindrome or not.
44. WAP to print series of odd numbers using while loop statements.
45. WAP to print series of even numbers using do….while loop statements.