Professional Documents
Culture Documents
14. Write a program in C++ that will print prime numbers from 20 to 90.
15. Write a program in C++ that will print first 20 prime numbers.
16. Write a C++ program to print the sum of the following series:
i)
2 + 4+ 6 + 8 + 10 +.up to N terms.
ii)
13 + 33 + 53 + 73 + up to N terms.
iii)
1 + + 1/3 + + 1/5 .up to N terms.
iv)
1/22 + 1/42 + 1/62 + 1/82up to N terms.
17. Write a program in C++ That will compute the sum of the following series:
(1) + (1 + 2) + (1 + 2 + 3) + (1 + 2 + 3 + 4) + .. up to n terms.
18. Write a program in C++ That will compute the sum of the following series:
(22)+ (22+ 42) + (22+ 42 + 62) + (22 + 42 + 62 + 82) + .. up to n terms.
19. The temperature on the Celsius scale are related to those on the Fahrenheit scale by the formula:
C = 5/9*(F-32)
Write a program that prints the Celsius equivalent of Fahrenheit temperatures in the range low to
high where low and high be the input to the program.
20. Write a program in C++ that will print the following :
Note: The Input to your program is number of rows.
(a) * * * * *
(b) * * * * * (c)
*
****
****
***
***
***
*****
**
**
*
*
21. Write a Program in C++ that will print the following:
$
$ $
$ $ $
$ $
$
The Input to your program is the maximum number of $ sign.
22. Write the Program in C++ that will print the following:
*
* * *
* * * * *
* * *
*
The Input to your program is the maximum number of asterisks.
23. Write the Program in C++ that will print the following:
1
12
123
1234
The Input to your program is the number of rows.
24. Write the Program in C++ that will print the following:
A BCD
BCD
CD
D
The Input to your program is up to which alphabetic character (here D).
25. Write the Program in C++ that will print the following:
A
B A
C BA
D CBA
C BA
B A
A
The Input to your program is up to which maximum alphabetic character (here D).