Wa0030.
Wa0030.
2. Write a program to read 3 numbers. Display sum and average of all numbers.
3. Write a program to read 2 numbers and display difference.
4. Write a program to read 2 numbers and display quotient and reminder.
5. Write a program to read price and quantity and display bill amount to pay.
6. Write a program to read price and quantity. Consider 10% discount and display bill amount to
pay.
7. Write a program to read basic salary. Consider 30 days per month. Display per day salary.
8. Write a program to read basic salary and number of days present. Consider 30 days per month.
Display salary to pay.
9. Write a program to read basic salary. Give 20% commission. Display total salary to pay.
10. Write a program to display area of shaded part
a. A) B) C)
11. Write a program to read 2 numbers and display maximum and minimum number.
12. Write a program to read 2 numbers and exchange the numbers and print them.
13. Write a program to read 2 numbers and exchange the numbers without using extra variable and
print them.
14. Write a program to solve the equation aX2 + bXY + cY2. Read value for a, b, c and also for X and Y.
15. Write a program to read loan amount, interest rate. Display simple interest. Consider duration
of 1 year.
16. Write a program to read loan amount, interest rate. Display monthly installment. Consider
duration of 1 year.
17. Write a program to read loan amount, duration, interest rate. Display simple interest.
18. Write a program to read loan amount, duration, interest rate. Display monthly installment.
19. Write a program to read 2 numbers and display largest and smallest number without using
control statement.
20. Write a program to read 2 numbers and display difference. Difference must be positive.
21. Write a program to read price and quantity. Calculate bill amount. If bill amount is greater than
2000 give 20% discount. Display actual amount to pay.
22. Write a program to read basic salary. If basic salary is less than 10000, give 15% commission.
Display total salary to pay.
23. Write a program to read price and quantity. Calculate bill amount. If bill amount is greater than
2000 give 20% discount else give 10% discount. Display actual amount to pay.
24. Write a program to read basic salary. If basic salary is less than 10000, give 15% commission else
give 10% commission. Display total salary to pay.
25. Write a program to read 2 numbers and display largest number.
26. Write a program to read 3 numbers and display largest number.
27. Write a program to read a number and display whether number if positive or negative.
28. Write a program to read a number and display whether number if even or odd.
29. Write a program to read year. Display whether leap year or not.
30. Write a program to read 2 numbers. Display largest without comparing 2 numbers with each
other.
31. Write a program to read total marks obtained. Consider to total marks out of 500. Display class
obtained depending upon following conditions
a. If total marks obtained < 45 then fail
b. If total marks obtained >= 45 and total marks obtained<60 then pass class
c. If total marks obtained >= 60 and total marks obtained<66 then first class
d. If total marks obtained > 66 then first class with distinction.
32. Write a program to read loan amount. Display monthly installment. Consider duration of 1 year.
If loan amount <10000 consider interest rate as 15% else 12%.
33. Write a program to read loan amount and duration ( in years). Display monthly installment. If
duration < 5 consider interest rate as 15% else 12%.
34. Write a program to read loan amount and duration (in years). Display monthly installment. For
interest rate consider following table
Loan Amount Duration Interest Rate
<5 18%
<10000
>=5 16%
<5 17%
>=10000
>=5 12%
35. Write a program to read basic salary and number of days present. Consider 30 days per month.
Give commission and display total salary to pay. For commission consider following table.
Basic Salary Number of Commission
days present
<25 18%
<5000
>=25 16%
<25 17%
>=5000
>=25 12%
36. Write a program to display your name 10 times.
37. Write a program to display your name 10 times with sr.no. before number
38. Write a program to read 5 numbers using for loop. Display addition of all the inputted numbers.
(Without using array)
39. Write a program to read 10 numbers using for loop. Display addition of even numbers only.
40. Write a program to read 10 numbers using for loop. Display average of odd numbers only.
41. Write a program to read 10 numbers using for loop. Display addition of even numbers and odd
numbers separately.
42. Write a program to read 10 numbers using for loop. Display average of even numbers and odd
numbers separately.
43. Write a program to read 10 numbers using for loop. Display addition of even numbers and odd
numbers separately. You are allowed to use only one if control statement (No if-else is
allowed) in program.
44. Write a program to read 10 numbers. Display average of first 2 numbers only.
45. Write a program to read 10 numbers. Display average of last 2 numbers only.
46. Write a program to read 10 numbers. Display average of first 2 even numbers only.
47. Write a program to read any number and print all the number from 1 to inputted number.
48. Write a program to read any number and display addition of all the number from 1 to inputted
number.
49. Write a program to read any number and display addition of all the number even numbers from
1 to inputted number.
50. Write a program to read any number and display average of all the number odd numbers from 1
to inputted number.
51. Write a program to read any number and print factorial of the number.
52. Write a program to read value of X and N. Display XN.
53. Write a program to read value of X and N. Display XN / N!
54. Write a program to print following series.
0 1 1 2 3 5 8 13 …. N.
55. Write a program to print following series.
1 4 9 16 …. N2.
56. Write a program to print following series.
0 1 3 6 10 15 21 …. N.
57. Write a program to print following series.
1 2 6 12 20 30 42 ……. N2+N.
58. Write a program to read any number and print number of digits.
59. Write a program to read any number and display addition of digits.
60. Write a program to read any number and display average of digits.
61. Write a program to read any number and display average of even digits only.
62. Write a program to read any number and print reverse number.
63. Write a program to read any number and check for palindrome or not.
64. Write a program to read any number and print addition of last 2 numbers.
65. Write a program to read any number and print average of last 2 numbers.
66. Write a program to read any number and print addition of first 2 numbers.
67. Write a program to read any number and print average of first 2 numbers.
68. Write a program to print following patterns.
+++++ 12345 11111 +++++ 55555 12345 12345
+++++ 12345 22222 ++++ 4444 1234 4444
+++++ 12345 33333 +++ 333 123 123
+++++ 12345 44444 ++ 22 12 22
+++++ 12345 55555 + 1 1 1
1 1 * * 1 5 1
12 12 ** ** 22 54 **
123 123 *** *** 333 543 123
1234 1234 **** **** 4444 5432 ****
12345 12345 ***** ***** 55555 54321 12345
1 A A A A A A
23 AB BC CC AA AAA BCD
456 ABC DEF EEE AAA AAAAA EFGHI
78910 ABCD GHIJ GGGG AAAA AAAAAAA JKLMNOP
1 A A A * * *
111 BC BC BCD *** *** ***
11111 DEF DEF EFGHI ***** ***** *****
1111111 GHIJ GHIJ JKLMNOP ******* ******* *******
KLM KLM QRSTU ***** ***** *****
NO NO VWX *** *** ***
P P Y * * *
E E E 5 5 5 5 1
DD DD DE 45 45 5 4 45 AB
CCC CCC CDE 345 345 543 345 123
BBBB BBBB BCDE 2345 2345 5432 2345 ABCD
AAAAA AAAAA ABCDE 12345 12345 543212345 12345
69. Write a program to read character and print it.
70. Write a program to read a character and print in lower case.
71. Write a program to read a character and print in upper case.
72. Write a program to read a string and print the inputted string.
73. Write a program to read a string and print total number of characters including blank space
without using any string function.
74. Write a program to read a string and print the inputted string into lower case.
75. Write a program to read a string and print the inputted string into upper case.
76. Write a program to read a string and print the inputted string and print the string with
alternate upper and lower case character. Start with upper case character.
77. Write a program to read a string and print the inputted string and print the string with
alternate upper and lower case character. Start with lower case character.
78. Write a program to read a string and check whether string is palindrome or not? (Without
using any string function)
79. Write a program to read a string and print total number of vowels.
80. Write a program to read a string and print total number of blank spaces.
81. Write a program to read two strings and print by concatenating 2 string into third without
using any string function.
82. Write a program to read a string with multiple lines. (User must input * to terminate the
sting)
83. Write a program to read a string and print total number of sentences.
84. Write a program to read a string and print total number of words.
85. Write a program to read a string and print the string by removing extra blank spaces if
exists.
86. Write a program to read a string and print total number of sentences and words.
87. Write a program to read a string and print total number of sentences and words.
88. Write a program to read any multiple line/sentence string and display string with every
sentence’s first character as upper case and remaining into lower case.
89. Write a program to read any string and display string with every words first character as
upper case and remaining into lower case.
90. Write a program to read 5 numbers for array. Display all the array number.
91. Write a program to read 5 numbers for array. Display all the array number with Even or Odd
92. Write a program to read 5 numbers for array. Display all the array number with addition of
digits.
93. Write a program to read 5 numbers for array. Display all the array number with average of
digits.
94. Write a program to read 5 numbers for array. Display all the array number in reverse order.
95. Write a program to read 5 numbers for array. Display minimum number and it’s position
from array.
96. Write a program to read 5 numbers for array. Display maximum number and it’s position
from array.
97. Write a program to read 10 numbers for array. Display minimum number from array first
five and maximum number from remaining 5.
98. Write a program to read 10 numbers for array. Display addition of first 2 even numbers only.
99. Write a program to read 10 numbers for array. Display addition of last 2 even numbers only.
100. Write a program to read 10 numbers for array. Display addition of those numbers which
are present at even index position.
101. Write a program to read 10 numbers for array. Display addition of those even numbers
which are present at even index position.
102. Write a program to read 10 numbers for array. Display average of those even numbers
which are present at even index position.
103. Write a program to read 10 numbers for array. Display addition of first 2 odd numbers
only.
104. Write a program to read 10 numbers for array. Display addition of last 2 odd numbers
only.
105. Write a program to read 10 numbers for array. Read 2 index positions. Display minimum
between those 2 index positions.
106. Write a program to read 10 numbers for array. Read 2 index positions. Display
maximum between those 2 index positions.
Index 0 1 2 3 4 5 6 7
Number 12 23 4 56 4 3 1 4
Consider 2 index positions as 2 and 6. Then maximum number will be 56 and minimum number
will be 1
107. Write a program to read 10 numbers for array. Read 2 index positions. Rotate down
numbers between 2 positions down word and display array numbers.
Index 0 1 2 3 4 5 6 7
Number 12 23 4 56 4 3 1 4
Consider 2 index positions as 2 and 6. Then modified array after rotation will be
Index 0 1 2 3 4 5 6 7
Number 12 23 1 4 56 4 3 4
108. Write a program to read 10 numbers for array. Display numbers along with reverse
number and average of digits.
109. Write a program to read two dimensional array of 3X3. Display in matrix format.
110. Write a program to read two dimensional array of 3X3. Display in transpose matrix
format
111. Write a program to read two dimensional array of 3X3. Display in even matrix format i.e.
display only even numbers others as 0.
112. Write a program to read two dimensional array of 3X3. Display in odd matrix format i.e.
display only odd numbers others as 0.
113. Write a program to read two dimensional array of 3X3. Display matrix with row wise
addition.
114. Write a program to read two dimensional array of 3X3. Display
i. Upper matrix
ii. Lower matrix
iii. Diagonal matrix.
115.