Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Lab Assignment – 1
Paper Name : Programming for Problem Solving Lab (BCAC192)
1. WAP to input two numbers and interchange(swap) their value.
2. WAP to input three numbers and print the smallest number. 3. WAP to input three numbers and print the second largest number. 4. WAP to input three angles and check whether these three angles make a triangle or not. If yes print its type. 5. WAP to input three sides and check whether these three sides make a triangle or not. If yes print its type. 6. WAP to input three sides of a triangle and check whether the triangle is a right angled triangle or not. 7. WAP to input marks of 5 subjects, find average and assign Grade. Avearge Marks Grade 90 and above O 80 to 89 E 70 to 79 A 60 to 69 B 50 to 59 C 40 to 49 D 8. WAP to input purchase amount, calculate discount and print payable amount. Purchase Amount Discount(%) Upto Rs. 2000.00 NA 2001.00 – 5000.00 5% 5001.00 – 10000.00 10% 10001.00 and above 15% 9. WAP to input consumed unit and calculate Electricity Bill. Consumed Unit Charge(Rs. Per Unit) Upto 300 8 301-700 10 701 and above 12 10. Write a Menu driven program to calculate area of square, rectangle and circle. 11. Write a Menu driven program to convert temperature Celcius to Fahrenheit and vice versa. 12. WAP to input a number find its Factorial. 13. WAP to find the sum of Series : 1 + 2^2 + 3^2 + ..... + n^2. 14. WAP to find the sum of Series : 1 – 2^2 + 3^3 - ...... + n^n. 15. WAP to find the sum of Series : 1 + (1+2) + (1+2+3) + ...... + (1+2+3+...+n). 16. WAP to find the sum of Series : 1 + (1*2) + (1*2*3) + ...... + (1*2*3*...*n). 17. WAP to find the sum of Series : 1 + 2/2! + 3/3! + .... + n/n!. 18. WAP to print the first 10 numbers of Fibonacci series. 19. WAP to input a number and check whether the number is Perfect or not. 20. WAP to input a number and check whether the number is Prime or not. 21. WAP to input a number and check whether the number is Armstrong or not. 22. WAP to input a number and check whether the number is Palindrome or not. 23. WAP to input a number and check whether the number is Automorphic or not. 24. WAP to input a Decimal number and convert to its equivalent Binary number. 25. WAP to input a Binary number and convert to its equivalent Decimal number.