List of C Program
List of C Program
1. Add, subtract, multiply or divide two integers. Read and display your name.
4. Convert given days into year and month and display the result.
7. Calculate and display all prime numbers between any two integers.
9. Sort a list of numbers in ascending / descending order and hence print them. Also print the
maximum and minimum number.
13. Add and subtract two same size matrices and display the result.
14. Display all the diagonal element of a square matrix in matrix form.
15. Display all the elements except the diagonal element of a square matrix.
18. Multiply two matrices (if possible) and display the result.
19. Read a few number of integer and calculate the sum and mean of those integers.
20. Read the values of P and Q and print that are divisible by 5 and 7 (/5 or7), where P and Q
are integers and P<Q.
21. Read the total monthly consumption and compute the monthly electric bill of a household.
Given the rate of electricity is Tk. 2.50 per unit for first 100 units, Tk. 4.00 per unit for the
next 100 units and Tk. 7.00 per unit for above 200 units. There is also a line rent of Tk. 120
per month and 15% tax on the total number of units consumed.
Page 1 of 2
(ii) If 100 sales Tk. 500, then commission=10% of sales.
(iii) If sales Tk. 500, then commission=Tk. 50+15% of sales above Tk. 500.
23. Determine the following: [use for loop and do while loop]
(c) 13 + 23 + 33 + … … + n3 ;
26. Read obtained mark of a course between 1 and 100 and calculate the grade as follows:
Mark ≥ 80 ‘A+’; Mark ≥ 75 ‘A’; Mark ≥ 70 ‘A-’;
Mark ≥ 65 ‘B+’; Mark ≥ 60 ‘B’; Mark ≥ 55 ‘B-’;
Mark ≥ 50 ‘C+’; Mark ≥ 45 ‘C’; Mark ≥ 40 ‘D’;
Mark ≤40 ‘F’.
Using switch statement.
27 Write a C program to read the values of two integers and calculate their Least common
multiple and Greatest common divisor.
Also
2 print the value of ab − h 2 and = a b c + 2 f g h − a f 2 − b g 2 − c h 2 .
30 Read the values g , f and c of the circle x2 + y 2 + 2 gx + 2 fy + c = 0 and then calculate the
radius and centre of the circle.
31 Add, subtract, multiply or divide two integers using user defined function.
32 Circle area and gcd of two integers using user defined function.
https://www.geeksforgeeks.org/c-programming-language/
https://www.w3schools.com/c/c_functions.php
Page 2 of 2