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

Programmin in C Lab Programs

Helpful for aktu students
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)
25 views

Programmin in C Lab Programs

Helpful for aktu students
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

S.

Programs
No.

1 Write a Program to print different data types in ‘C’ and their ranges.

2 Write a C program to find the sum and average of three numbers.

3 Write a program to swap the values of two variables with and without using the third variable.

4 Write a Program to read radius value from the keyboard and calculate the area of circle and
print the result in both floating and exponential notation.

5 Write a program to find whether the given year is a leap year or not.

6 Write a program that checks whether the two numbers entered by the user are equal or not.

7 Write a program to find the greatest of three numbers.

8 Write a program that finds whether a given number is even or odd.

9 Write a program that tells whether a given year is a leap year or not.

10 Write a program that accepts marks of five subjects and finds percentage and prints grades
according to the following criteria:

Between 90-100%-----Print ‘A’

80-90%-----------------Print ‘B’

60-80%-----------------Print ‘C’

Below 60%-------------Print ‘D’

11 Write a program that takes two operands and one operator from the user, perform the
operation, and prints the result by using Switch statement.

12 Write a program to print the sum of all numbers up to a given number.

13 Write a program to find the factorial of a given number.

14 Write a program to print sum of even and odd numbers from 1 to N numbers.

15 Write a program to print the Fibonacci series.

16 Write a program to check whether the entered number is prime or not using function

17 Write a program to find the reverse of a number using a function.

18 Write a program to print Armstrong numbers from 1 to 100 using a function.

19 Write a recursive function to calculate the factorial of a given number.

20 Write a program that simply takes elements of the array from the user and finds the sum of
these elements using function.
21 Write a program that inputs two arrays and saves the sum of corresponding elements of these
arrays in a third array and prints them.

22 Write a program to find the minimum and maximum element of the array.

23 Write a program to search an element in an array using Linear Search.

24 Write a program to sort the elements of the array in ascending order using Bubble Sort
technique.

25 Write a program to add and multiply two matrices of order n x n.

26 Write a program that finds the sum of diagonal elements of a m x n matrix.

27 Write a program to implement strlen (), strcat (),strcpy () using the concept of Functions.

28 Write a program Define a structure data type TRAIN_INFO. The type contains Train No.:
integer type Train name: string Departure Time: aggregate type TIME Arrival Time: aggregate
type TIME Start station: string End station: string The structure type Time contains two integer
members: hour and minute. Maintain a train timetable and implement the following
operations:

a. List all the trains (sorted according to train number) that depart from a particular section.

b. List all the trains that depart from a particular station at a particular time.

c. List all the trains that depart from a particular station within the next one hour of a given
time.

d. List all the trains between a pair of start station and end station

29 Write a program to swap two elements using the concept of pointers.

You might also like