30 Questions To Improve Logic Building in Programming
30 Questions To Improve Logic Building in Programming
building in programming
Prerequisite
Any one programming language
(C, C++, Java, Python)
1. WAP to take 2 numbers as input and print the
addition of those 2 numbers
2. WAP to find average of 3 numbers
3. WAP to find Simple Interest
4. WAP to convert temperature in degree Celsius to
Fahrenheit
5. WAP to check whether an entered number is
positive or negative
6. WAP to check whether an entered year is Leap year
or not
7. Write a menu driven program for simple calculator
8. WAP to find the grade of a student. Take input
marks of 3 subjects and calculate the percentage.
If percentage > 85 print A grade,
If percentage < 85 && percentage >= 75 print B
grade,
If percentage < 75 && percentage >= 50 print C
grade,
If percentage > 30 && percentage <= 50 print D
grade,
If percentage <30 print fail
9. WAP to find sum of all numbers within a given
range
10.WAP to print multiplication table of an entered
number
11. WAP to print whether an entered number is prime
or not
12.WAP to find factorial of a number
13. WAP to count number of digits in a number
14. WAP to find sum of all digits of a number
15. WAP to check whether an entered number is an
armstrong number or not
16. WAP to reverse an entered number
17. WAP to check whether an entered number is
palindrome or not
18. WAP to find all the prime numbers from 1 to n
19. Pattern Program 1
*******
*******
*******
*******
20. Pattern Program 2
*
* *
* * *
* * * *
* * * * *
21. Pattern Program 3
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
* * *
* * * * *
* * * * * * *
* * * * * * * * *
23. Pattern Program 5
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
23
456
7 8 9 10