C Programs
C Programs
1) Program to display the power value when base and exponent (power) is given.
2) Program to display the count of digits and sum of the digits in a given number
3) Program to display the count of Uppercase characters in a given string
4) Program to display the cube of the numbers from 1 till n using for loop.
5) Program to display Fibonacci series till n
6) Program to display the sum of first and last digits of a given number
7) Program to display the GCD of 2 numbers using while loop
8) Program to calculate mileage (mileage= distance/fuel consumed) by accepting the
distance travelled and fuel consumed. Mileage
9) Program to display the multiplication table of given number
10) Program to display different patterns using the numbers, alphabets or special characters
11) Program to check for a palindrome number
12) Program to check for a perfect number
13) Program to check for a prime number
14) Program to display the quadrant when x and y are given
15) Program to display the digit at units place of a given number
16) Program to display the block name by accepting the branch of the student. For CSE,
BLOCK-1 , for CSIT, BLOCK-2, for AIDS, BLOCK-3, for ECE, BLOCK-4 and for
other branches it is BLOCK-5
17) Program to display the grade of the student accepting the average narks of the student
Average grade
<45 F
45-55 E
56-65 D
66-75 C
76-85 B
86-100 A
18) Program to check whether the person is eligible for driving license or not. His age should
be 18 or above and passed the driving test.
19) Program to calculate the Commission for Sales as 5% on total sales accepting the Sales
done on that day
20) Program to display YES if the sum of the digits in a given number is 6 otherwise display
NO
21) Program to check whether a number if +ve, -ve or zero
22) Program to swap 2 numbers using bitwise operators, using 3 rd variable without using 3rd
variable
23) Program to check whether the given character is a vowel or a consonant
24) Program to display the area and perimeter of a triangle
25) Program to display the given single digit number in word form. Eg: for 1 display as ONE,
for 2 display as TWO, and so on…
26) Program to convert temperature from centigrade to Fahrenheit and vice versa
27) Program to check whether a given number is divisible by 5 and 7 or not using conditional
operator
28) Program to check whether a person is eligible to vote or not
29) Program to calculate Simple Interest accepting the principle amount, time period and rate
of interest
30) Program accept values into an array and display the maximum value in that array
31) Program to display even values in an array.
32) Program to accept age of 'N' persons and display the count of persons in each category
using while loops. Consider 0-3 years as infants, >3 and <=17 as minor and >=18 as
major
33) Program to perform Matrix subtraction
34) Program to perform matrix multiplication
35) Program to perform matrix transpose
36) Program to perform matrix addition
37) Program to check for a value in an array using linear search
38) Program to check for a value in an array using binary search
39) Program to sort the values using Bubble sort
40) Program to copy a string to another string variable without using string function
41) Program to find the length of a string without using string function
42) Program to display respective message by accepting the temperature. Temp < 0 Frozen,
Temp 0-20 Cold , Temp 20-30 Normal, Temp >30 Hot
43) Program to display the sum of numbers till n using recursion
44) Program to calculate area and perimeter of a rectangle and display the one which is
greater
45) Program to display the sum of even numbers till n
46) Program to check whether the given number is a duck number or not. A number is called
a duck number if it contains zero 0.
47) Program to display the count of even numbers will n and also display the sum of those
even numbers
48) Program to display the factorial of a number
49) Program to convert the given character in lower case to upper case
50) Program to display the number of days present in a given month accepting the month
number in the year. If it is 1 then display 31, if its 2 display as 28, if it 3 display as 31,
and so on.
51) Develop a C program based on the following information to calculate the electricity bill.
Consumption Unit Rate of charge
0 -150 Rs 3 per unit
151 – 300 Rs 100 + Rs3.50 per unit exceeding 150 units
301 – 400 Rs 225 + Rs4.50 per unit exceeding 300 units
Above 400 Rs 350 + Rs6 per unit exceeding 400 units
52) Develop a C program to calculate net salary of an employees, accepting basic salary and
calculating HRA as 12% of basic, TA 10% of basic, da as 10 % of basic, pf as 8% of
basic and pt as 5% of basic.
53) Program to display the smallest and largest values in a given array
54) Program to display YES if the given number is even and is a multiple of 8, NO if the
given number is odd and is a multiple of 11. If above conditions does not match then
display as CANNOT DECIDE.
55) Program to display numbers from n to 1
56) Program to display the midpoint of the given distance when the distance is given in miles.
Consider 1 mile = 1.6 Kilometers
57) Program to display the given days into years, weeks and days
58) Program to accept n values into an array and display the sum of array values till the given
indices and display it. For example, if 4 5 3 7 2 are values in an array, then your output
should be 4 9 12 19 21
59) Program to check whether the given number is a power of 2 or not using bitwise
operators
60) Body Mass Index (BMI) is a measure of health based on height and weight. You can
calculate your BMI by taking your weight in kilograms and dividing it by the square of
your height in meters. The interpretation of BMI for people 20 years or older is as
follows:
BMI Interpretation
BMI < 18.5 Underweight
18.5 <= BMI <25.0 Normal
25.0 <=BMI < 30.0 Overweight
30.0<= BMI Obese