Vous êtes sur la page 1sur 2

1. WAP that asks the user to enter a number and displays multiplication table of that number.

2. WAP to read a six-digit number from the user, if it is even number then add its digit else multiply
the digits.
3. WAP to find maximum and minimum out of n number.
4. WAP to reverse a number.
5. WAP to that takes a real number and prints the sum of the digits of this number.
6. WAP to find
a. Sum of first n numbers.
b. Average of n numbers.
c. Minimum out of n numbers.
d. Maximum out of n numbers.
e. Sum of first n odd numbers.
f. Sum of first even number starting from a given number.
7. WAP to count the number of students who have obtained A, B, C, D and F grades. The
grades are awarded according to the following rules.

Grade Percentage
A >=80
B >=70
C >=60
D >=50
F <50

8. WAP, to find the position of the largest value in the sequence of n numbers.
9. WAP to find factorial of a number n.
[Hint: factorial of n=(n)*(n-1)* …… *1]
10. Generate following pattern
Input: Enter a value: - 5

(i) ***** (ii) *


**** **
*** ***
** ****
* *****

(iii) * (iv) *****


** ****
*** ***
**** **
***** *

(v) 1 (vi) 1
232 22
34543 333
4444
55555
(vi)
(vii) 1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

11. WAP to calculate the power of a number. Take number and power from the user.
[Hint y = xn ]
12. WAP to check a number is prime number or not.
13. WAP that accepts an input integer N in the range 0-9, and display the following pattern on a
cleared screen.
Sample input for n=3 Sample input for n=4
Sample output Sample output
3 4
323 434
32123 43234
323 4321234
3 43234
434
4
14. WAP to generate a following series.
(a) 1, 1, 2, 3, 5, 8, 13, 21, 34, ……….
(b) 1, 4, 9, 16, 25, ……………
(c) 1, 8, 27, 64, ………
(d) 1, 3, 5, 7, 9, ………
(e) 2, 4, 6, 8, 10, ………….
(f) 1, 2, 6, 24, 120, ………
15. Write a loop to solve the following expression
i =p (1+r)t –p

Vous aimerez peut-être aussi