0% found this document useful (0 votes)
15 views

Test Component 3

Uploaded by

vidhibothra00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Test Component 3

Uploaded by

vidhibothra00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Principles of Programming

1. The marks obtained by a student in 3 different subjects are given as input through the
keyboard. The student gets the grade as per the following rules:
Grade 1: Mark greater than or equal to 80
Grade 2: Mark between 79 to 60
Grade 3: Mark lesser than 60
Write a C program to calculate the grade obtained by the student
2. Write a C program to print all natural numbers in reverse from n to 1 using while loop.
3. Write a C program to compute the series: X1+X2+X3+ ... +XN\
4. Write a C program to get 3 integers from the user and find the second largest number
5. Write a C program to count the number of digits in a number
6. Write a C program to display hollow square star pattern as follows:
*****
* *
* *
* *
*****
7. Write a C program to check whether a triangle is valid or not, when the three angles of the
triangle are entered through the keyboard. A triangle is valid if the sum of all the three
angles is equal to 180 degrees.
8. Write a C program to find the first and last digit of a number
9. Write a C program to find the sine series:

10. Write a C program to convert the given seconds into hours, minutes and seconds.
11. Write a C program to check whether a number is prime or not
12. Write a C program to find the cosine series:

13. If cost price and selling price of an item is input through the keyboard, write a C program to
determine whether the seller has made profit or incurred loss. Also determine how much
profit he made or loss he incurred.
14. Write a C program to calculate overtime pay of an employee. Overtime is paid at the rate of
Rs. 100 per hour for every hour worked above 40 hours.
15. Write a C program to compute the series: 11+22+33+ … +NN
16. Write a C program to determine whether the given year is a leap year or not.
17. Write a C program to find the value of one number raised to the power of another. Do not
use the standard pow() function.
18. Write a C program to compute the series: 1/(1*1) + 1/(2 * 2) + 1/(3 * 3) + 1/(4 * 4) + ……
+ 1/(n * n).
19. Given the length and breadth of a rectangle, write a C program to find whether the area of
the rectangle is greater than its perimeter.
20. Write a C program to obtain the reverse of a 4 digit number.
21. Write a C program to compute the series: 0 + 3 + 8 + 15 + 24 + 35 + 48 + 63 + … (till 100)
22. Any year is input through the keyboard. Write a C program to determine whether the year is
a leap year or not.
23. Write a C program to compute the series: 0 + 1 + 3 + 6 + 10 + 15 + … + N
24. Write a C program to compute the series: 1/1+ 1/2 + 1/3 + 1/4 + 1/5 + ... 1/N
25. Write a C program to display the following number pattern:
1
22
333
4444
5 5555
26. Write a C program to display the following number pattern:
1
12
123
1234
1 2345
27. Write a C program to display the following number pattern:
11111
00000
11111
00000
11111

28. Write a C program to display Inverted Right Triangle star pattern as follows:
*****
****
***
**
*

You might also like