Questions for Practical File CS-XI

advertisement
Questions for Practical File
1)
2)
3)
4)
5)
6)
7)
8)
9)
10)
11)
12)
13)
14)
15)
16)
17)
18)
19)
20)
21)
22)
23)
24)
25)
26)
27)
28)
29)
30)
WAP to calculate the sum of two nos.
WAP to find roots of quadratic equation.
WAP to convert Fahrenheit to Celsius.
WAP to swap two numbers without using a temporary variable.
WAP to calculate are of a triangle, rectangle, cuboid, cylinder, sphere, and hemisphere.
WAP to calculate SI and CI.
WAP to check odd and even.
WAP to check eligibility to vote.
WAP to check whether a number is negative or positive.
WAP to enter weekday and print week name (Using If and Switch)
WAP to enter month and print month name(Using If and Switch)
WAP to enter the digit and print it in words.
WAP to print the sum of entered digits ( 345 sum must be 12)
WAP to print reverse of entered digit (3456 – 6543)
WAP to print the sum of digit at odd and even places.
WAP to print the sum of odd and even digits.
WAP to print the sum of first and last digit.
WAP to print the sum of all the digits except first and last digit.
WAP to find the Pythagorean triplet between 1 to 500.
WAP to find maximum of N input numbers.
WAP to test whether the input no is Armstrong number or not.
WAP to test whether the input no is prime or not.
WAP to display the Armstrong numbers between 1 and 500
WAP to display the prime numbers between 1 and 100.
WAP in C++ to check whether the input integer is automorphic or not .
WAP in C++ to find H.C.F of two input numbers.
WAP in C++ to find the sum of the digits of an input number.
WAP in C++ to find the L.C.M. of two numbers.
WAP to print Fibonacci series.
WAP to print the series given below :
a. 1+2+3+4+5 ……………….N
b. 2+4+6+8+10………………..N
c. 1+3+5+7+9………………….N
d. 12+22+……………………N
e. 13+23+33+…………………..N
f. 1+1/2+1/3+1/4+……………….1/n
g. 1-2+3-4+5-6…………………N
h. 0+1+1+2+3+5…………………N
i. 1+(1+2)+(1+2+3)+(1+2+3+4)+………….N
j. 3+9+18+27+……………………..N
k. 5+10+20+30+40……………….N
31) WAP that converts a decimal integer into binary integer.
32) WAP that converts a binary integer into a decimal integer.
33) WAP to print the following patterns:
i)
A
ii)
1
iii)
1
A
B
1
2
2
3
A
B
C
1
2
3
4
5
iv)
H
H
H
H
H
V)
E
E
E
E
L
L
L
L
L
O
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
6
VI)
1
1
1
3
4
1
2
1
3
6
1
4
1
34.
Create a matrix of order M X N and transpose it. Display the original and transposed matrix.
35. Create a two-dimensional array and find the highest and lowest element of each row.
36. Create an array of N elements and sort the elements in ascending order.
37. Create a two-demensional array of M X N elements. Write a program to find the row wise
sum.
38. Write a program in C++ to find the column wise sum of a two dimensional array consists of
M X N elements.
39. WAP that reads astring and check if the string is a palindrome.
40. WAP to replace every blank space in astring with an * (asterisk).
41. WAP to count the number of times an inputed character is present in a string .
42. WAP in C++ to create a matrix of order 3 x 3 and find the sum of the diagonal elements .
43. WAP that reads a string and a character .It then converts each sequence of the given character to
opposite case .
44. WAP in C++ to display the following series
0 1 1 2 3 5 8 .....................upto N terms .
45. WAP to find the sum of odd numbers of a matrix of order M X N.
46. WAP which finds the reverse of a number using function.
47. WAP in C++ that uses a function called carea() to calculate area of a circle.The function
carea() receives radius of type float type and returns area of double type. The function main()
gets aradius value from the user, calls carea() , and display the result .
48) Write a c++ program to take a two-dimensional array A, with size N rows and N columns as argument and print the
upper half of the array. E.g.
2
7
2
If A is
3
1
5
1
5
7
2
3
1
1
5
7
49) Consider a 1-D array ‘A’ containing 100 integers. Develop a program to do the
Following:
Remove all occurrences of a given integer
Shift the elements of the array to the right so that used space is available at the left end.
Fill the unused spaces by 0 (Zero).
(For example the array
10 20 15 4 20 2 20
After execution of the program for given integer 20 should become
0
0 0
10 15 4 2
50) Write a program in C++ to use 2 D array and print the following sequences as shown below:
Eg:
1
2
0
5
1
2
4
5
4
4
3
7
3
3
6
4
8
6
2
7
5
9
1
3
8
51) Transpose of matrix.
B) Trace of Matrix. (1+4+3+2+8).
C)
3
7
0
5
3
6
3
6
D) 1 2 3 4 5 9 1 3 8 7 6 4 1 5 0 2 4 7 8 6 2 3 4 5 3
1
E)
0
2
0
0
0
2
4
0
4
4
0
0
0
0
6
4
8
6
2
0
0
0
0
0
0
Download