Program List No-3
Program List No-3
Note: - apply for, while, do-while, goto, break & continue control structure according to your own logic.
8. WAP to calculate average of all those number between 100 to 300 which is divisible by 5, 7 & 10.
9. WAP to input n value from user & display max number between then. Don’t use array.
10. WAP to count number of digit in input integer number. (Ex-4123 has 4 digit).
11. WAP to display all digit of input integer number in reverse order. (Ex- input-5439output-9345)
12. WAP to display * in following manner. Design all for n number of lines.
13. Write a program to calculate overtime pay of employees. Overtime is paid at the rate of Rs. 12.00 per
hour for every hour worked above 40 hours. Assume that employees do not work for fractional part of
an hour.
14. Two numbers are entered through the keyboard. Write a program to find the value of one number
raised to the power of another.
15. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of
the number is equal to the number itself, then the number is called an Armstrong number. For example,
153 = ( 1 * 1 * 1 ) + ( 5 * 5 * 5 ) + ( 3 * 3 * 3 )
16. Write a program to enter the numbers till the user wants and at the end it should display the count of
positive, negative and zeros entered.
17. Write a program to find the range of a set of numbers. Range is the difference between the smallest
and biggest number in the list.
18. Write a program to print all the ASCII values and their equivalent characters using a while loop. The
ASCII values vary from 0 to 255.
19. WAP to display all divisor of an input number.(EX- input-12 output- 1, 2, 3, 4, 6, 12)
20. WAP to calculate least common factor of three numbers.
21. WAP to calculate highest common factor of three numbers.
22. WAP to print all prime numbers from 1 to 300. (Hint: Use nested loops, break and continue)
23. WAP to fill the entire screen with a smiling face. The smiling face has an ASCII value 1.
24. WAP to add first seven terms of the following series using a for loop:
1/1! +1/2! + 1/3! +…….
25. WAP to generate all combinations of 1, 2 and 3 using for loop.
26. According to a study, the approximate level of intelligence of a person can be calculated using the
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.