0% found this document useful (0 votes)
8 views

Programming For Problem Solving All Questions

Uploaded by

naughtybalak22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Programming For Problem Solving All Questions

Uploaded by

naughtybalak22
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Q1. Write a C program to find sum and product of all digit of a number.

Number should be input through


keyboard.

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
...

Q5. Write a program to produce the following output:


A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A

Q6. Write a program to produce the following output:


1
2 3
4 5 6
7 8 9 10

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.

Q12. Write a menu-driven program which has the following options:


1. Factorial of a number.
2. Prime or not
3. Odd or even
4. Exit

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.

[Hint: Make use of infinite loop and a switch statement. ]

You might also like