Programmin in C Lab Programs
Programmin in C Lab Programs
Programs
No.
1 Write a Program to print different data types in ‘C’ and their ranges.
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.
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:
80-90%-----------------Print ‘B’
60-80%-----------------Print ‘C’
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.
14 Write a program to print sum of even and odd numbers from 1 to N numbers.
16 Write a program to check whether the entered number is prime or not using function
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.
24 Write a program to sort the elements of the array in ascending order using Bubble Sort
technique.
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