CP Practice Questions
CP Practice Questions
27.write a C program to check string is palindrome or not and count the character frequency using
function.
28.write a C program to swap strings without using string function.
21. Write a C program to display month name for a accepted month number.
23. Write a C program to implement a simple calculator (+, - , /, % mod) . Accept two numbers and
accept one char. input (Arithmetic symbol). Based on accepted char input program must perform the
operation.
24. Write a C program that will read the values of a, b, c, d, m and n and compute the values of x1 and
x2. An appropriate message should be printed if ab-cd=0.
25. Write a C program to read empid , no.of hours,,rate per hour and calculate pay and tax (based on
pay) as if pay<300 give 15% of the pay otherwise 28% of the pay.Also calculate netpay =pay-tax.
26. Write a C program to accept custtno, units as integer consumed by customer and calculate charges
as float based on accepted units .
Score=100 Grade= A+
Score>=90 Grade=A
Score>=80 Grade=B
Score>=70 Grade=C
Score>=60 Grade=D
Otherwise Grade=F
2.
1
11
111
1 1 1 1 upto n lines
3.
1
12
123
1234
12345
4.
1
22
333
4444
55555
5.
1
212
32121
4321321
6.
1
21A
321BA
4321CBA
54321DCBA
7.
*
**
***
****
8.
A
ABA
ABCBA
ABCDCBA
9.
****
***
**
*
10.
A
BC
DEF
GHIJ
Accept number of lines
11.
1
22
333
4444
55555
12.
1
121
12321
1234321
13.
P
PQ
PQR
PQRST
14.
*
**
***
****
15.
*
**
***
****
***
**
*
16.
*
**
***
****
***
**
*
17.
*****
****
***
**
*
18.
ABCDCBA
ABCBA
ABA
A
19.
1
121
12321
1234321
121
1
20.
5
54
543
5432
54321
21.
54321
5432
543
54
5
32. Program to that will allow the user to input ten scores in order to find the average of the scores.
34. Program to which reads an integer N followed by N numbers, prints each number and sum of
numbers read so far.