WAVE TECHTRONICS
Question bank
1. Wap to Add Number 2 number? (BASIC PROGRAMMING)
2. Wap to Subtract 2 numbers?
3. Wap to Multiply 2 number?
4. Wap to Divide 2 number?
5. Wap to swap two number?
6. Wap to swap two number without using third variable?
7. Wap to calculate area of rectangle?
8. Wap to calculate area of circle?
9. Wap to calculate area of cube?
10. Wap to calculate area of cuboid?
11. Wap to calculate square and cube of n number?
12. Wap to input the side of triangle and finds its area using herons’ formula.
13. Wap to input the character in lower case and convert it to upper case
14. Wap to input the character in upper case and convert it to lower case
15. Wap to convert the Celsius to Fahrenheit?
16. Wap to convert the Fahrenheit to Celsius?
17. Wap to covert the following:
• Hours-Min
• Min-Hours
• Hours-Sec
• Sec-Hours
• Hours-Min-Sec
• Sec-Min-Hours
• Days-Hours-Min-Sec
• Sec-Hours-Min-Hours
18. Wap to check whether a number is even and odd number? ( If-else )
19. Wap to check whether a number is a negative or positive number?
20. Wap to check whether a person is teenager or not?
21. Wap to check whether a person can vote or not?
22. Wap to check whether a year is leap year or not?
23. Wap to check whether a number is divisible by 5 or not?
24. Wap to check whether a number is divisible by 5 and 2 or not?
25. Wap to check whether a number is buzz number or not?
26. Wap to check whether a character is a vowel or consonant?
27. Wap to check whether a character is a vowel, consonant, number or a special
character or not?
28. Wap to take input of age and check the following:
0-12 Age KID
13-19 Age TEENAGER
20-60 Age Adult
61-100 Age Old
100> Not Defined
29. Wap to take input number and check the following:
0-9 Num Single Digit number
10-99 Num Double Digit number
100-999 num Triple digit number
1000> not defined
30. Wap to take an input of three number and check among three number which
one is greater and display the message?
31. Wap to input three number and check second smallest number among three
number?
32. Write a menu Driven program for Calculator:
(eg.)
Welcome to Calculator
Type 1 for Addition
Type 2 for Subtraction
Type 3 for Multiplication
Type 4 for Division
Enter the choice
1
Please enter the value of a
100
Please enter the value of b
200
The addition of a and b is 300
33. Write a menu driven program for GST calculator
(eg.)
Welcome to GST calculator
Enter the amount
10000
Type 1 for 18% percent Tax
Type 2 for 28% percent Tax
Type 3 for 5% percent Tax
Please enter the choice
1
The 18 percent tax is selected
The tax is 1800
The CGST is 900
The SGST is 900
The total tax is 1800
The total amount payable is 11800
34. Wap to input three sides of triangle and check weather if it is an isosceles,
equilateral or scalene triangle.
35. Input the unit and rate and calculate the final bill as per given conditions:
Unit<100 discount 30%
200>unit>=100, discount 20%
300>unit>=400 discount 10%
Otherwise, no discount and penalty of 200 rupees in the bill
36. Wap to enter the number and print the number n times (Loops).
37. Wap to print the following series:
• 0 1 1 2 3 5 8 13
• 0 0 1 1 2 4 7 13
• 1 2 3 4 5 6 7 8 9
• 2 4 6 8 10 12 14 16 18
• 1 3 5 7 9 11 13
• 1 11 111 1111 11111 11111
• 1 10 100 1000 10000 10000
• 1 4 9 16 25 36 49
• 2 4 8 16 32 64
• 0 3 8 15 24 35
• 2 5 10 17 26 37
38. Wap to check weather a number is a prime number or not?
39. Wap to check weather a number is a composite number or not?
40. Wap to check weather a number is twin prime number or not?
41. Wap to check weather a number is perfect number or not?
42. Wap to enter two number and print the lcm of two number?
43. Wap to enter two number and print the HCF of two number?
44. Wap to enter the number and print the table od n number?
45. Wap to print all the prime number from 1 to 1000?
46. Wap to print all the perfect number from 1 to 1000?
47. Wap for the following patterns:
****** 12345 11111 ****** *#*#*#*# 13579
****** 12345 22222 ###### *#*#*#*# 246810
****** 12345 33333 ****** *#*#*#*# 13579
****** 12345 44444 ###### *#*#*#*# 246810
54321 ******a aaaaa 123 d******** aaaaaaaa
54321 ******b bbbbb 456 c******** 11111111
54321 ******c cccccc 789 b******** bbbbbbbb
54321 ******d ddddd a******** 22222222
* 1 5 54321 aaaaa ***** 1
** 12 54 5432 bbbb #### 23
*** 123 543 543 ccc *** 456
**** 1234 5432 54 dd ## 78910
***** 12345 54321 5 e *
A1 CCCCC 1e a1 a
BB2 DDDD 12d b22 CC
CCC3 EEE 123c c333 eee
DDDD4 FF 1234b d4444 GGGG
EEEEEE5 G 12345a e55555 hhhhhh
* 1 a 5 54321
*** 12 ab 54 5432
**** 123 abc 543 543
***** 1234 abcd 5432 54
****** 123 abcde 54321 5
***** 12 abcd 5432 54
**** 1 abc 543 543
*** ab 54 5432
** a 5 54321
*
ABCED 111111 a 1
ABCD 22222 ab 12
ABC 3333 abc 123
AB 444 abcd 1234
A 55 abcde 12345
AB aaaaaa abcdef 123456
ABC bbbbb
ABCD ccccc
ABCDE ddd
1111111 abcdef 123456 1
222222 abcdre 12345 2 3
33333 abcd 1234 4 5 6
4444 abc 123 7 8 9 10
555 ab 12 11 12 13 14 15
66 a 1
* 1 5
** 1 2 5 4
*** 1 2 3 5 4 3
**** 1 2 3 4 5 4 3 2
***** 1 2 3 4 5 5 4 3 2 1
****** 1 2 34 5 432
***** 1 2 3 543
**** 1 2 54
*** 1 5
**
*
48. Wap to check weather a number is an Armstrong number or not?(while loop)
49. Wap to check weather a number is palindrome number or not?
50. Wap to check weather a number is a prime palindrome number or not?
51. Wap to check weather a number is a neon number or not?
52. Wap to check weather a number is a magic number or not?
53. Wap to check weather a number is a Niven number or not?
54. Wap to check weather a number is a happy number or not?
55. Wap to check weather a number is a spy number or not?
56. Wap to check weather a number is a duck number or not?
57. Wap to check weather a number is a spy number or not?
58. Wap to check weather a number is a special number or not?
59. Find the sum of the following series using do while loop:
1+2+3+4+5+6………………………….N
1!+2!+3!+4!+…………………………..N
1+1/2+1/3+1/4+1/5………………..N
1+1/2+1/4+1/8+1/16………………N
1+1.1+2.2+3.3+4.4+5.5……………N
1+3+5+7+9+11+13…………………..N
2+4+6+8+10+12+14…………………N
60. Wap to print Tribonacci series using do while loop:
0 0 1 1 2 4 7 13
61. Wap to print the sum of 1d array:
62. Wap to sort the 1d array using bubble sort
63. Wap to sort the 1d array using selection sort
64. Wap to search the value in the array using linear search
65. Wap to add 2 array and print the addition of array
66. Wap to input in array and print the reverse of the array?
67. Wap to take input in array and traverse the array?
69.Wap to sort the array in the following ways:
1.
Input in one Array :
10 20 30 40 50 60
Answer
20 10 40 30 60 50
2.
Input in two Array
Array a
10 20 30 40 50 60
Array b
11 22 33 44 55 66
Swap the values in the array
Answer of array a
11 20 33 40 55 60
Answer in array b
10 22 30 44 50 66
3.
Input in two Array
Input in two Array
Array a
10 20 30 40 50 60
Array b
11 22 33 44 55 66
Swap the values in the array
Answer of array a
22 20 44 40 66 60
Answer in array b
11 10 33 30 55 50
4.
Input int two Array
Input in two Array
Array a
10 20 30 40 50 60
Array b
11 22 33 44 55 66
Swap the values in the array
Answer of array a
10 11 30 33 50 55
Answer in array b
20 22 40 44 60 66
70.Wap 2 add two matrix of 3 rows and 3 columns ?
71.Wap to multiply wo matrix of 3 rows and 3 columns?
72.Wap to transpose of 3 by 3 matrix?
73.Wap to take input in 3 by 3 matrix and display the following patterns:
10 20 30
40 50 60
70 80 90
a. 10 20 30 40 50 60 70 80 90
b. 10 20 30 60 90
c. 90 60 30 20 10
d. 10 40 70 80 90
e. 90 80 70 40 10
f. 10 20 30 50 70 80 90
g. 90 80 70 50 30 20 10
74. Wap to take input in 3 by 3 matrix and print the sum of the following:
10 20 30
40 50 60
70 80 90
a. Sum of diagonal 10 + 50 + 90
b. Sum of diagonal 30 + 50 + 70
c. Sum of first row 10 +20 +30
d. Sum of second row 40 + 50 + 60
e. Sum of third row 70 + 80 90
f. Sum of 1 column 10 + 40 + 70
g. Sum of 2 column 20 + 50 + 80
h. Sum of 3 columns 20 60 90
i. Sum of 20 + 50 + 60 + 40 + 80
j. Sum of 10 +30 +70+ 90
String questions
75. Wap to input in a string and print the name of the person?
76. Wap to input in a string and print the reverse of the string?
77. Wap to input in string print all the vowels from the sting?
78. Wap to input a string and count all vowels and consonant from the string?
79. Wap to input a string and count all the special character from the string?
80. Wap to input a string and check weather a string is palindrome or not?
81. Wap to input a string and covert the string to upper case?
82. Wap to input a string and convert the string to lower case?
83. Wap to input a string and convert all the vowels present to upper case?
84. Wap to input a string eg:
input
Mohandas Karamchand Gandhi
Ouput :
M.K.Gandhi
85. Wap to input a string and counts the number of words present in the sting?
86. Wap to input a string and count the frequency of the character which is repeating in a
string?
87. WAP to input a string and arrange all the character in ascending order.
Eg. COMPUTER→CEMOPRTU
88. WAP to input a string and find the frequency of all the characters.
Eg. COMPUTER APPLICATION
89. Wap to input a string and replace all the vowels with ‘X’.
90 WAP to input a string and convert it into PIGLATING word.
Eg. TROUBLE → OUBLETRAY
91. WAP to input a string and replace the first letter with the last letter.
92. Wap to Input a string and print the initials of all the words.
Eg. WE ARE TRAVELLING
WAT
93. WAP to input a word and check if it is HAPPY WORD or not.
Eg. A=1,B=2,C=3,D=4……… Z=26
VAT 22 1 20 → 22+22+12+22+02= 13 → 12+32=10→12+02=1
If the result is 1 it is happy word.
94. WAP to input a string and print only those words which are having 2 same simultaneous
character. Eg
Utter, butter.
95. Wap to accept the tree letter word and print all the probable combination no letter
should repeat in the output.
Sample input: TOP
Sample output: TOP, TPO, OTP, PTO, POT
96. WAP to input a string and print only that word which have maximum number of vowels.
97. Write a program to enter a string in a mixed case. Arrange all the letters of string such
that all the lower case characters are followed by the upper case characters.
Sample Input:
Computer Science
Sample Output:
omputercienceCS
98. Write a program to accept a string. Count and display the frequency of each character
present in the string. The character with multiple frequencies should be displayed only
once.
Sample Input:
golden jubilee
Sample Output:
Alphabet g o l d e n j u b i
Frequency 1 1 2 1 3 1 1 1 1 1
99. Write a program to accept a string and display the new string after reversing the
characters of each word.
Sample Input:
Understanding Computer Science
Sample output:
gnidnatsrednU retupmoC ecneicS
100. While typing, a typist has created two or more consecutive blank spaces between the
words of a sentence. Write a program to eliminate multiple blanks between the words by
a single blank.
Sample Input:
Indian Cricket team tour to Australia
Sample Output:
Indian Cricket team tour to Australia