Programming For Problem Solving All Questions
Programming For Problem Solving All Questions
Q2. Write a C program to add the first n terms of the following series using a for loop: 1/1! + 2/2! +
3/3! ...
Q3. Write a program to generate all combinations of 1, 2 and 3 using for loop.
Q4. Write a program to print the multiplication table of the number entered by the user. The table
should get displayed in the following form:
29 * 1 = 29
29 * 2 = 58
...
Q7.According to a study, the approximate level of intelligence of a person can be calculated using the
following formula: i = 2 + ( y + 0.5 x ) Write a program, which will produce a table of values of i, y and x,
where y varies from 1 to 6, and, for each value of y, x varies from 5.5 to 12.5 in steps of 0.5
Q8. Write a program to generate all Pythagorean Triplets with side length less than or equal to 30.
Q9. The population of a town today is 100,000. The population has increased steadily at the rate of 10%
per year for the last 10 years. Write a program to determine the population at the end of each year last
decade.
Q10. Ramanujan number is the smallest number that can be expressed as a sum of two cubes in two
different ways. Write a program to print all such numbers up to a reasonable limit.
Q11. Write a program to print 24 hours of the day with suitable suffixes like AM, PM, Noon and
Midnight.
Once a menu item is selected the appropriate action should be taken and once this action is finished the
menu should reappear. Unless the user selects Exit option the program should continue to run.