C Programs 2024-2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

WAP to calculate the commission at the end of the month for a company,
which gives a 10% commission to its salesman if their monthly sales amount is
Rs 10,000 or more.
2. ABC Company gives a 5% commission to its salesman if their monthly sales
are less than Rs. 10,000 and a10% commission if is equal to or greater than Rs.
1 0,000 Calculate the commission at the end of the month.
3. XYZ Company gives allowances to its employees depending on their grade as
follows.

Grade Allowances
A 300
B 250
Others 100

Calculate the Salary at the end of the month

4. The company plans to give a year –end 5% bonus to each of its employees,
However if an employee has beenworking for 10 or more years at the company he
has to get an additional Rs. 500, lets calculate the bonus for any given employee
5. Montauk Company has decided to make their commission structure more
aggressive for their sales department as follows.

Sales Grade Commission


10,000 1 10%
2 8%
<=10,00 -- 5%
0
6.WAP to calculate the fare for a railway journey depending on the following
conditions.

Age Distance [ in Kms ] Fare


Below 10 Below 50 5
51 -100 10
Above 100 15
11-50 Below 50 10
51-100 15
Above 100 20
Above50 Below 50 15
51-100 20
Above100 25

7. WAP to initialize the Name of Student and his Average Marks and the assign him a
grade as per the following rules
a. AvgMarks >=90 then grade is A+
b. AvgMarks >=80 and <90 then grade is A
c. AvgMarks >=70 and <80 thengrade is B+
d. AvgMarks >=and <70 then grade is B
e. Avg Marks >=50 and <60 then grade is C
f. AvgMarks <50 then FALL

8. WAP to find the roots of a quadratic equation given by ax 2 + bx + c =0 If


b2- 4ac > 0 then print the roots are real and unequal
Rootl = ********** Root2 = *************
2a 2a v If b - 4ac = 0 then print the, roots are real and equal.
Root= — la
If b2- 4ac < 0 then print the roots are complex and imaginary.

9. The rates of income tax applicable on income of the individuals for the
assessment year 2003-2004 were as follows.

Net income Range Rates of Income Tax


Up to Rs 50000 Nil
Above Rs. 50000 but up 10% of the amount by which
to Rs. 60000. the
total income exceeds Rs.
50000
Above Rs. 60000 but up Rs. 1000 plus 20% of the
to Rs 150000. amount by which the total
income exceeds Rs. 6
thousand
Above Rs. 150000 Rs. 19000 plus 30% of the
amount by which the total
income exceeds Rs. 150000.

10. A student appears for a test in 3 subjects. Each test is out of 100 marks. The
percentage of each student has to be calculated and depending on the
percentage calculated, grades are given as under.

Percentage Grade
>=90 A+
80-89 A
70-79 B+
60-69 B
50-59 C+
<50 Fail
11. Create a menu-based program to find the addition, division, multiplication, and
Subtraction of two numbers depending upon the user's choice.
12. WAP to create a menu driven program to do the following:
a. Area of Rectangle
b. Diagonal of Rectangle
c. Perimeter of Rectangle
Using the switch-case statement, write a menu driven program to do the following :
13. To display the sum of the series given below:
x1 + x2 + x3 + ……………. xn terms
(b) To input a number and check and print whether it is a Pronic number or not. (Pronic
number is the number which is the product of two consecutive integers)
Write a program in C to accept a string in lower case and change the first letter of every word
to upper case. Display the new string.

14. Using the switch-case statement, write a menu driven program to do the following :
(a)To display the following series:
0, 7, 26, 63 p terms.
(b) To input a number and check and print whether it is a Pronic number or not. (Pronic
number is the number which is the product of two consecutive integers)
Write a program in C to accept a string in lower case and change the first letter of every word
to upper case. Display the new string.

15. Using the switch-case statement, write a menu driven program to do the following :
(a) To display the sum of the series given below:

(b)To accept a number and check and display whether it is a spy number or not. (A number is spy if
the sum of its digits equals the product of its digits.)
Example : consider the number 1124,
Sum of the digits = l + l+ 2 + 4 = 8
Product of the digits = 1×1 x2x4 = 8
16. WAP to create a menu driven program to do the following:
a. Area of Rectangle
b. Diagonal of Rectangle
c. Perimeter of Rectangle
17. WAP to input a No and find the frequency of each digit of a No.
18. WAP to print all the Armstrong Nos. between 1 to 500
19. Print the Pythagorean triplets between 1 to 100.
(sum of square of two successive nos. is equal to the third one) 33+ 44=52
20. WAP to print the following series.
a) 1!+2!+3!+4! ……………………….n!
b) 1,11,111……………………….n
c) 1+(1+2)+(1+2+3)+(1+2+3+4)+……………….(1+2+3……..20)

You might also like