C Practice Set
1. Write a Program in C to find the Area of a circle.
2. Write a Program in C to swap two 2 Numbers.(with and Without using 3rd variable).
3. Write a program to convert Celsius temperature into Fahrenheit.
4. Write a program to input five numbers through the keyboard and print their sum and
average.
5. Write a Program in C to calculate the area of Triangle using Herons Formula.
6. Write a Program in C to find the Roots of a Quadratic Equation.
7. Write a Program in C to check a number is Even or Odd.
8. Write a Program in C to check Year is Leap Year or Not.
9. Write a C program to check whether a number is negative, positive or zero.
[Link] a C program to check whether a number is divisible by 3,5 and 11 or not.
[Link] a Program in C to find the Greatest Number among 3 Numbers.
[Link] a C program to check whether the triangle is equilateral, isosceles or scalene triangle.
[Link] a Program in C to calculate the Division of a Student.(Assume number of subjects
are 5 and marks gained by students is entered by student through Keyboard)
[Link] a C program to input marks of five subjects Physics, Chemistry, Biology,
Mathematics and Computer. Calculate percentage and grade according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
[Link] a C program to input basic salary of an employee and calculate its Gross salary
according to following:
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
[Link] a C program to find the eligibility of admission for a professional course based on
the following criteria:-
Marks in Maths >=65
Marks in Phy >=55
Marks in Chem>=50
Total in all three subject >=180
[Link] a C program to find the eligibility of admission for a professional course based on
the following criteria:-
Marks in Maths >=65
Marks in Phy >=55
Marks in Chem>=50
Total in all three subject >=180
[Link] a program to find the value of y for a particular value of k using (if and switch)
If k=1 y=ax+b
If k=2 y=ax2+b2
If k=3 y=ax
If k=4 y=a+x
[Link] a C program to find the value of y using
1+x when n=1
Y(x,n)= 1+x/n when n=2
1+xn when n=3
1+nx when n>3 or n<1
[Link] the length and breadth of a rectangle , write a program to find whether the area of the
rectangle is greater than its perimeter.
[Link] to input month number and print name of the month using (if and switch).
[Link] a C program to calculate the commission for a sales representative as per the sales
amount given below
1. If sales <= Rs 500, commission is 5%
2. If sales > 500 but <= 2000, commission is 10%
3. If sales > 2000 but <= 5000, commission is 15%
4. If sales > Rs 5000, commission is 15.5%
[Link] a Program in C to Print Electricity bill. Electric power distribution company charge
its domestic as follows:-
UNIT RATE OF CHARGE
0-200 Rs 2.50 per Unit
201-400 Rs 100 + Rs 3.0 per unit excess of 200
401- 600 Rs 390 + Rs 4.50 per unit excess of 400
601 AND ABOVE Rs 475+ Rs 5.0 per Unit excess of 600
[Link] a C program to read temperature in centigrade and display a suitable message
according to temperature state below : -
Temp < 0 then Freezing weather
Temp 0-10 then Very Cold weather
Temp 10-20 then Cold weather
Temp 20-30 then Normal in Temp
Temp 30-40 then Its Hot
Temp >=40 then Its Very Hot
[Link] his basic salary is less than Rs.1500, then HRA=10% of basic salary and DA=90% of
basic Salary. If his salary is either equal to or above Rs. 1500, then HRA=Rs. 500and DA
=98% of basic salary .If the employee’s salary is input through the keyboard WAP to find its
gross salary.
26. Write a program in C language to check Character is a Vowel or Consonant. (using if –else
and Switch case statements ).
[Link] a program in C language to print Calculator using switch case.
[Link] Enumerated Data type write a program in c to print name of Months.
29. Write a Program in C to Print all Natural Numbers from X to Y.
30. Write a Program in C to calculate the sum of all natural numbers from 100 to 550
31. Write a Program in C to calculate the Factorial of a Number.
32. Write a Program in C to find the Multiplication of all the Digits of a number.
33. (a)Write a Program in C to Find the Reverse of any Number.
(b) Program to check whether the given number is Buzz Number or not.( A number is said to be
Buzz Number if it ends with 7 OR is divisible by 7. Like :-63,87 etc)
34. Write a Program in C to Check the Number is Palindrome or not
35. Write a Program in C to Check Number is Armstrong or Not.
36. Write a Program in C to all Armstrong Number From X to Y.
37. Write a Program in C to Check Number is a Prime Number or Number.
38. Write a Program in C to print all Prime Numbers from x to y.
[Link] a Program in C to calculate the GCD of any Number.
[Link] a Program in C to print Table of any Number
[Link] a Program in C to Check Number is Perfect or Not.
[Link] a Program in C to print Fibonacci Series upto n terms.
[Link] a Program in C to print the following Pattern
1
12
123
1234
12345
[Link] a Program in C to print the following Pattern
*
* *
* * *
* * * *
[Link] a Program in C to print the following Pattern
1
22
333
4444
55555
[Link] a Program in C to print the following Pattern
5
44
333
2222
11111
[Link] a Program in C to print the result of following series:-
X1 *x2 *x3 *x4 - - - - - - - - - - - - xn
48. Write a Program in C to print the result of following series:-
1! +2! +3! +4! + - - - - - - - - - - n!
49. Write a Program in C to print the result of following series:-
Sum = x – x3/3! + x5/5! – x7/7! + x9/9! – x11/11!
50. Write a Program in C to print the result of following series:-
a/nx +(a+1)/ nx + (a+2)/ nx + - - - - - - - - - +(a+y)/ nx
[Link] a Program in C to print Row Matrix of Order n*n.
[Link] a Program in C for Addition of 2 matrix of Order n*n.
[Link] a Program in C for Multiplication of 2 Matrix of Order n*n.
[Link] a Program in C to Print Transpose of a Matrix of Order 3*3.
[Link] a Program in C to Search any Element in a Matrix n*n.
[Link] a Program in C to find the Maximum and Minimum value element in a Matrix of order n*n.
[Link] a Program in C to Sort and Array of n elements.
[Link] a Program in C to find the Greatest Number among 10 Numbers .
[Link] a Program in C to Swap two Numbers using Pointers .
[Link] a Program in C to find the Sum of Diagonal Elements.
[Link] to find whether a given square matrix is symmetric or not
[Link] a program in C to find the average of all the elements of a matrix of order m*n.
[Link] a Program in C to calculate Factorial of any Number using Recursion.
[Link] a Program in C to Print sum of all the digits of a number using Recursion.
65. Using Recursion write a program in C to print Fibonaci Series upto n terms.
[Link] to create structure for student, details are name, father’s name, roll no, height and
marks. Input details of 5000 students and print the detail of those students who secured more
than 70% marks.
[Link] a Program in C to Create a Union to store the Records of 500 Students ( Name, [Link], Dat
Birth, Address ,Fees) and print the records of those Students who Belong to Lucknow only.
[Link] a Program in C to Check String is a Palindrome or Not.
[Link] a Program in C to Copy the Content of One File into other File.
[Link] a Program in C to count total number of blank spaces in a file.
[Link] a Program in C to count total number of vowels in a text file.