C Programs For Colleges
C Programs For Colleges
C Programs For Colleges
ENGINEERING
– CS8261 & TECHNOLOGY,
CHENNAI
C Programming – CS8261
2017-‘18
Compiled by
Program 1:
Aim:
Create a program in C to display your college name and format it using format specifiers.
Source code:
# include<stdio.h>
# include<conio.h>
void main()
clrscr();
printf("\n\t\t\t\t\tChennai");
getch();
Output:
Program 2:
Aim:
Source code:
2
C Lab Manual – CS8261
# include <stdio.h>
# include <conio.h>
void main()
{
int a = 10;
float b = 20.5;
char c = 'C', d[] = "RVS Padmavathy";
clrscr();
printf("\n\na = %d\nb = %f\nc = %c\nd = %s\n",a,b,c,d);
getch();
}
Output:
a = 10
b = 20.500000
c=C
d = RVS Padmavathy
Program 3:
Aim:
Source code:
Output:
3
C Lab Manual – CS8261
Program 4:
Arithmetic operations.
Aim:
Source code:
Output:
4
C Lab Manual – CS8261
Program 5:
Relational operations
Aim:
Source code:
Output:
Program 6:
Logical operators
Aim:
Source code:
5
C Lab Manual – CS8261
Output:
Program 7:
Bitwise operators.
Aim:
Source code:
6
C Lab Manual – CS8261
Output:
Program 8:
Aim:
Source code:
Output:
7
C Lab Manual – CS8261
Program 9:
Sizeof() function
Aim:
Source code:
Output:
Program 10:
Accepting characters using getchar() function from keyboard and display it using putchar().
Aim:
Create a program in C to accept characters from key board and display it.
Source code:
8
C Lab Manual – CS8261
Output:
Program 11:
Accepting characters using getche() ant getch() then display it using putch().
Aim:
Create a program in C to accept characters using getche() and getch() functions then display it using
putch() function.
Source code:
9
C Lab Manual – CS8261
Output:
Program 12:
Aim:
Source code:
Output:
10
C Lab Manual – CS8261
Program 13:
Aim:
Create a program in C to accept and display captions using gets() and puts() functions.
Source code:
Output:
Program 14:
Aim:
Create a program in C to accept and display strings using cgets() and cputs() functions.
11
C Lab Manual – CS8261
Source code:
Output:
Program 15:
Aim:
Source code:
Output:
12
C Lab Manual – CS8261
Program 16:
Aim:
Source code:
Output:
Program 17:
Aim:
Source code:
13
C Lab Manual – CS8261
Output:
Program 18:
Create a report card using if – else – if ladder using the following constraints.
Aim:
Deptartment of Computer Science and Engineering
14
C Lab Manual – CS8261
Source code:
15
C Lab Manual – CS8261
Output:
16
C Lab Manual – CS8261
Program 19:
Aim:
Create a program in C to perform basic arithmetic operations using switch case structure.
Source code:
Output:
17
C Lab Manual – CS8261
Program 20:
Aim:
Source code:
Output:
18
C Lab Manual – CS8261
Program 21
Aim:
Source code:
Output:
Program 22
Aim:
Source code:
19
C Lab Manual – CS8261
Output:
Program 23
Aim:
Source code:
20
C Lab Manual – CS8261
Output
Program 24
Aim:
Source code:
21
C Lab Manual – CS8261
Output:
Program 25
Aim:
Source code:
22
C Lab Manual – CS8261
Output:
Program 26
Aim:
Source code:
Output:
23
C Lab Manual – CS8261
Program 27
Aim:
Source code:
Output:
Program 28
24
C Lab Manual – CS8261
Aim:
Source code:
Output:
Program 29
Aim:
25
C Lab Manual – CS8261
Source Code:
Output:
Program 30
Aim:
26
C Lab Manual – CS8261
Source code:
Output:
Program 31
Aim:
Source code:
27
C Lab Manual – CS8261
Output:
Program 32
Aim:
Source code:
28
C Lab Manual – CS8261
Output:
Program 33
Aim:
Source code:
Output:
Program 34
Find the length, reverse and Check palindrome of the given string
Aim:
Create a program in C to find length, reverse and check the given string is palindrome or not.
Source code:
29
C Lab Manual – CS8261
Output:
Program 35
Aim:
Create a program in C to count vowels, consonants, words and blank space of a line of string.
Source code:
30
C Lab Manual – CS8261
Output:
Program 36
Aim:
Source code:
31
C Lab Manual – CS8261
Output:
32
C Lab Manual – CS8261
Program 37
Substring removal.
Aim:
Create a program in C to find a substring and remove it from the main string.
Source code:
33
C Lab Manual – CS8261
34
C Lab Manual – CS8261
Output:
Program 38
Aim:
Source code:
35
C Lab Manual – CS8261
Output:
Program 39
Aim:
Source code:
36
C Lab Manual – CS8261
Output:
Program 40
Fibonacci series
37
C Lab Manual – CS8261
Aim:
Source code:
Output:
Program 41
Aim:
38
C Lab Manual – CS8261
Source code:
39
C Lab Manual – CS8261
Output:
Program 42
Matrix multiplication
Aim:
Source code:
40
C Lab Manual – CS8261
41
C Lab Manual – CS8261
Output:
Program 43
Matrix transpose
Aim:
Program:
42
C Lab Manual – CS8261
Output:
Program 44
Determinant of a matrix
Aim:
Source code:
Output:
43
C Lab Manual – CS8261
Program 45
Insertion sort
Aim:
Source code:
Output:
44
C Lab Manual – CS8261
Program 46
Bubble sort
Aim:
Source code:
Output:
45
C Lab Manual – CS8261
Program 47
Linear search
Aim:
Source code:
Output:
46
C Lab Manual – CS8261
Program 48
Aim:
Source code:
Output:
Program 49
Aim:
Source code:
47
C Lab Manual – CS8261
Output:
Program 50
Aim:
Source code:
48
C Lab Manual – CS8261
Output:
Program 51:
Aim:
Source code:
Output:
49
C Lab Manual – CS8261
Program 52
Call by reference.
Aim:
Source code:
Output:
Before swap x = 10 y = 20
After swap x = 20 y = 10
Program 53
Recursion – Factorial.
Aim:
Source code:
50
C Lab Manual – CS8261
Output:
Program 54
Aim:
Source code:
51
C Lab Manual – CS8261
Output:
Program 55
a = 5 <= 8 && 6 != 5
Aim:
Source code:
Output:
Program 56
Function as an argument
Aim:
Source code:
52
C Lab Manual – CS8261
Output:
Program 57
Aim:
Source code:
53
C Lab Manual – CS8261
Output:
Program 58
Strlen()
Aim:
Source code:
54
C Lab Manual – CS8261
Output:
Program 59
Strcpy().
Aim:
Source code:
Output:
55
C Lab Manual – CS8261
Program 60
Strcmp()
Aim:
Source code:
Output:
56
C Lab Manual – CS8261
Program 61
Aim:
Source code:
Output:
Program 62
Strcat()
Aim:
Source code:
57
C Lab Manual – CS8261
Output:
Program 63
Strrev().
Aim:
Source code:
Output:
58
C Lab Manual – CS8261
Program 64
Aim:
Source code:
Output:
Value of a =5
Value of b = 10
Sum of a and b : 15
Value of x =5
59
C Lab Manual – CS8261
Address of x = 65518
Value of y = 10
Address of y = 65516
Sum of x and y : 15
Program 65
Aim:
Source code:
Output:
Program 66
Aim:
Source code:
60
C Lab Manual – CS8261
Output:
Life is beautiful
Program 67
Structures.
Aim:
Source code:
Output:
61
C Lab Manual – CS8261
Program 68
Aim:
Source code:
Output:
62
C Lab Manual – CS8261
Program 69
Aim:
Source code:
63
C Lab Manual – CS8261
Output:
Program 70
Aim:
Source code:
64
C Lab Manual – CS8261
Output:
Program 71
Union
Aim:
Source code:
65
C Lab Manual – CS8261
Output:
Program 72
Preprocessor
Aim:
Source code:
66
C Lab Manual – CS8261
Output:
67
C Lab Manual – CS8261
68
C Lab Manual – CS8261
69
C Lab Manual – CS8261
70
C Lab Manual – CS8261
71
C Lab Manual – CS8261
72
C Lab Manual – CS8261
73
C Lab Manual – CS8261
74
C Lab Manual – CS8261
75
C Lab Manual – CS8261
76
C Lab Manual – CS8261
77
C Lab Manual – CS8261
78
C Lab Manual – CS8261
79
C Lab Manual – CS8261
80
C Lab Manual – CS8261
81
C Lab Manual – CS8261
82
C Lab Manual – CS8261
83
C Lab Manual – CS8261
84
C Lab Manual – CS8261
85
C Lab Manual – CS8261
86
C Lab Manual – CS8261
87
C Lab Manual – CS8261
88
C Lab Manual – CS8261
89
C Lab Manual – CS8261
90
C Lab Manual – CS8261
91