All Assignment
All Assignment
Where
Annual salary = Monthly Salary * 12
Monthly Salary= Basic Salary + DA + HRA – PF – INS
DA(Dearness Allowance) = 115 % of Basic Salary
HRA(House Rent Allowance) = 25 % of Basic Salary
PF(Provident Fund) = 10 % of Basic Salary
INS(Insurance) = 12 % of Basic Salary
SWITCH Statement
30. WAP to accept a number from 1 to 7 and display the corresponding
weekday starting from Monday.
31. WAP to accept a number from 1 to 12 and display the corresponding
Month.
32. WAP to accept two numbers and an Arithmetic Operator from user.
Perform the operation on two numbers as per the operator entered.
33. Write a Menu based program to accept a choice from user and as per the
choice, perform any one of following.
Area of Square
Area of Rectangle
Area of Circle
Area of Triangle(Heron’s Formula)
34. Write a Menu based program to accept a choice from user and as per the
choice, perform any one of following.
Volume of Cube
Volume of Cuboid
Volume of Sphere
Volume of Cylinder
35. WAP to accept an Alphabet and Display it is a Vowel or Consonant.
LOOPS
36. WAP to display all numbers from 1 to 20.
37. WAP to display all even numbers from 2 to 200.
38. WAP to display all odd numbers from 165 to 97.
39. WAP to accept a number and display sum of all even numbers and odd
numbers separately from 1 to that number.
40. WAP to accept a number and display its Factorial.
41. WAP to accept two numbers and display all numbers from first number
till last number.(first number can be greater or less than second number).
42. WAP to accept a number and display its table.
43. WAP to display following series
1 4 7 10 13 16 19 22 25 …………………………………..200
1 2 4 8 16 32 64 128 256 …………………………………200
1 4 9 16 25 36 42 ………………………………………….400
1 1 1 2 4 8 3 9 27 4 16 64 ……………………....................8000
0 1 1 2 3 5 8 13 21 34 55 ………………………………….200
0 1 1 2 4 7 13 24 44 ……………………………………….200
1 2 4 7 11 16 22 29 37 46 56………………………………200
1 2 5 10 17 26 37 50 ………………………………………200
1 3 7 13 21 31 43 57 ………………………………………200
44. WAP to accept a number and display total digits in it.
45. WAP to accept a number and display sum of its digits.
46. WAP to accept a number and display product of digits.
47. WAP to accept a number and display Reverse number.
48. WAP to accept a number and display it is a Palindrome number or not.
49. WAP to accept a number and display it is an Armstrong number or not.
50. WAP to accept a number and display it is a Buzz number or not.
51. WAP to accept a number and display it is an Automorphic number or
not.
52. WAP to accept a number and display it is a Prime number or not.
53. WAP to accept two numbers and display their HCF.
54. WAP to accept two numbers and display their LCM.
NESTED LOOPS
55. WAP to display tables of all numbers from 5 to 17.
56. WAP to display all Palindrome numbers from 1 to 500.
57. WAP to display all Prime numbers from 1 to 200.
58. WAP to display all Armstrong numbers from 1 to 10000.
59. WAP to display factors of all numbers from 12 to 40.
60. WAP to display all Buzz numbers from 1 to 200.
61. WAP to display all Automorphic numbers from 1 to 20000.
62. WAP to generate following Patterns
* 1 1
** 22 12
*** 333 123
**** 4444 1234
***** 55555 12345
63. WAP to generate following Patterns
$ 1 1
$$ 22 12
$$$ 333 123
$$$$ 4444 1234
$$$$$ 55555 12345
@ 1 1
@@ 22 1 2
@@@ 333 1 2 3
@@@@ 4 4 4 4 1 2 3 4
@@@@@ 5 5 5 5 5 1 2 3 4 5
65. WAP to generate following Patterns
12345 &&&&& 5 5 5 5 5
1234 &&&& 4 4 4 4
123 &&& 3 3 3
12 && 2 2
1 & 1
66. WAP to generate following patterns
123454321 1
1234321 212
12321 32123
121 4321234
1 543212345
67. WAP to generate following pattern
1 1
12 21
123 321
1234 4321
1234554321
ARRAYS
68. WAP to accept 15 numbers in an Array and display the Largest number
and Smallest number stored in it.
69. WAP to accept 15 numbers in an Array and display largest, second
largest and third largest number stored in it.
70. WAP to accept N numbers in an array and display sum of all elements at
even positions.
71. WAP to accept N numbers in an array and add 2 to all odd numbers in
array and multiply 2 to all even numbers.
72. WAP to accept 12 numbers in an array and swap first half of Array with
its second half.
73. WAP to accept N numbers in an Array. Now accept a number and
position from user and insert that number at that position in the Array.
74. WAP to accept N numbers in an Array in ascending order. Now accept
a number and insert it in Array in such a way that even after insertion, Array
remains sorted.
75. WAP to accept 10 numbers in an array. Accept a position from user and
delete the element at that position from Array.
76. WAP to accept N numbers in an Array. Accept a number from user and
check for its existence in Array using Linear Search Technique.
77. WAP to accept N numbers in an Array. Accept a number from user and
check for the position of its existence in Array using Linear Search Technique.
78. WAP to accept N numbers in an Array. Accept a number from user and
check number of times it exists in Array using Linear Search Technique.
79. WAP to accept 15 numbers in an Array in descending order. Accept a
number from user and check for its existence using Binary Search Technique.
80. WAP to accept 12 numbers in an Array and sort them using Selection
Sort Technique.
81. WAP to accept 10 numbers in an Array and sort them using Bubble Sort
Technique.
82. WAP to accept 15 numbers in an Array and sort them using Insertion
Sort Technique.
83. WAP to accept N numbers in Array A and M numbers in Array B. Merge
elements of both arrays in Array C in such a way that first comes the element
of Array A and then of Array B.
84. WAP to accept N numbers in Array A and M numbers in Array B. Merge
elements of both arrays in Array C in such a way that first comes even elements
of Array A and Array B and then odd numbers of Array A and Array B.
85. WAP to accept N numbers in Array A and M numbers in Array B. Merge
elements of both arrays in Array C in such a way that even elements of Array
A and Array B come in Array C from left to right and odd numbers of Array
A and Array B from right to left.
86. WAP to accept N numbers in Array A in ascending order and M numbers
in Array B in descending order. Merge the elements of both arrays in Array C
using Merge Sort Technique in such a way that Array C contain all elements
in descending order.
87. WAP to accept numbers in a 2D array of N rows and M columns and
display sum of all Border elements.
88. WAP to accept numbers in a 2D array of N rows and M columns and
display sum of all left diagonal elements.
89. WAP to accept numbers in a 2D array of N rows and M columns and
display sum of all right diagonal elements.
90. WAP to accept numbers in a 2D array of N rows and M columns. Accept
a Row number from user and display sum of all elements of that row.
91. WAP to accept numbers in a 2D array of N rows and M columns. Accept
a Column number from user and display sum of all elements of that column.
92. WAP to accept numbers in a 2D array of N rows and M columns. Display
sum of all rows and columns separately.
93. WAP to accept numbers in a 2D array of N rows and M columns and
Transpose the given Array.
94. WAP to accept numbers in a 2D array of N rows and M columns and
another 2D array of M rows and T columns. Display the product of both
Matrices.
STRINGS
95. WAP to accept your first name and display it 10 times,
96. WAP to accept your full name and display it 5 times.
97. WAP to accept a String from user and display its length.
98. WAP to accept a String from user and display total Capital alphabets,
Small alphabets and digits stored in it.
99. WAP to accept a String and display total words in it.
100. WAP to accept your full name and display its initials only.
101. WAP to accept a String and convert it to Title Case.
102. WAP to accept a String and convert it to toggle case.
103. WAP to accept first name, middle name and last name separately.
Combine the three names to create full name.
104. WAP to accept two strings. Add second string after first string.
105. WAP to accept a string and reverse it.
106. WAP to accept a string and check it is a Palindrome or not.
107. WAP to accept a String and display each word in reverse.
For eg if String is “Ram is a good Boy”
Then output should be maR si a doog yoB
108. WAP to accept a String and diplay words in reverse order.
For eg if String is “Ram is a good Boy”
Then output should be Boy good a is Ram
FUNCTIONS
109. WAP to accept 3 numbers and display their Average using UDF which
accept three numbers as Parameter and return their sum.
110. WAP to accept two numbers and swap their values using UDF which
accept two numbers as parameters and swap their values,
111. WAP to accept two numbers and display all numbers from first number
to second number using UDF that accepts the two numbers as parameter.
112. WAP to accept a number and display it is Palindrome or not using UDF
that accepts a number and returns the reverse number.
113. WAP to accept a number and display it is Armstrong number or not using
UDF that accepts a number as parameter and return 1 if no is Armstrong else
return 0.
114. WAP to accept a number from user and display it is a Prime number or
not using UDF that accepts number as parameter and returns alphabet ‘Y’ if
number is Prime else returns alphabet ‘N’.
115. WAP to accept a number from user and display its table using UDF that
accept the number as Parameter and display its Table.
116. Define a function that accepts a character and a number as parameter and
display that character, that number of times. Define the function in such a way
that if number is not passed then the character is displayed 12 times and if
character and number both are not specified then ‘*’ is displayed 12 times.
117. WAP to overload function Area( ) to calculate area of square, Rectangle,
Circle or Triangle.
118. WAP using Recursive functions to display the following series
i) 2 4 6 8 10 12 14 ……………………….100
ii) 1 2 4 7 11 16 22 ……………………….100
iii) 0 1 1 2 3 5 8 13 ………………………..100
iv) 99 97 95 93 91 89 ……………………..1
119. WAP using a Recursive function that accepts a number and returns its
Factorial.
STRUCTURE
120. WAP to accept name, age and salary of 2 Persons using Structure.
121. WAP to accept Roll no, name, class, section and percentage of 15
Students using Structure.
122. WAP to accept first name, mid name, last name, area, exchange and
number of phone of a person using nested structure.
123. A structure Time contain 3 integer elements for Hour, Minute and
Second.
A UDF SUMTIME( ) accepts 2 objects of structure Time as Parameter and
return the sum of both Times.
WAP to accepts 2 sets of times and display total time in Hour, Minute and
Second.
124. WAP to accept name, department, post and salary of 15 Employees and
sort them on department using Selection Sort technique.
125. WAP to accept name, department, post and salary of 15 Employees and
sort them on salary in descending order using Insertion Sort technique.