You are on page 1of 9

Index

Sr. Date Topic Page Sign.


No No.
SET-1 SIMPLE “C” PROGRAMS
1 Write a program to print “hello world!” 10
2 Write a program to read one number and display it. 11
3 Write a program that will obtain the length and width 12
of a rectangle from user and calculate its area,
perimeter and diagonal.
4 Write a program to convert the kilometre into meter, 13
centimetre, feet and inch.
5 Write a program to calculate the area of a triangle 15
given by the formula a=sqrt(s(s-a)(s-b)(s-c)), where
a, b and c are the sides of the triangle and 2s=a+b+c.
6 Write a program to convert Fahrenheit to Celsius. 16
7 Write a program to convert Celsius to Fahrenheit. 17
8 Write a program to find the Sum of the Digits of a 3- 18
digit Integer constant.
9 Write a program to reverse Digits of a Number. 19
10 Write a program to Interchange the values of two 20
Variables.
11 Write a program to assign value of one variable to 21
another using post and pre increment operator and
print the results.
12 Write a program to read the price in decimal form and 22
separate rupees and paisa.
13 Write a program to convert days into months and vice 23
versa.
14 Write a program to perform Addition, subtraction, 24
Multiplication and modulo.

I
SET–2 WRITE PROGRAM USING IF ELSE & SWITCH STATEMENT.
1 Write a program to read marks from the keyboard 25
and your program should display equivalent grade
according to following table.
2 Write a program for the solution of quadratic 27
equation.
3 Write a program to make simple calculator using 29
switch and if....else if.
4 Write a program to find maximum and minimum 31
number from three number using ternary operation.
5 Check if given year is leap year or not. 34
6 Convert the case of a given character. 35
7 Write a program to find out Net Salary, HRA, DA and 36
PI of employee according to basic salary. Do using if
else and also switch statement.
8 The cost of one type of mobile service is Rs.250 plus 37
Rs.1.25 for each call made over and above 100 calls.
Write a program to read customer codes and calls
made and print the bill for each customer.
SET-3 ‘C’ PROGRAMS USING FOR, WHILE & DO-WHILE LOOPS.
1 Write a program to print first N natural number and 39
their Sum and average using “while” Loop
2 Write a program to print squares and cubes of first n 40
natural numbers and calculate their sum & average
3 Write a program to print all the numbers between -n 42
and n.
4 Write a program to print first n odd & even number & 44
calculate their sum & average.
5 Write a program to print all the numbers between the 45
given numbers x & y including x & y and also
calculate their sum & average.

II
6 Write a program to print all odd and even numbers 47
between given two numbers x & y including x & y &
calculate their sum and average.
7 Write a program to print every third number 48
beginning from 2 until the number<100 and calculate
their sum & average.
8 Write a program to print all numbers exactly divisible 51
by 5 until no<100, and calculate their sum and
average using modulus operator to check divisibility.
9 Write a program to print the following series:-15, -10, 53
-5, 0, 5, 10, 15.
10 Write a program to print value of the following series: 55
-1, x, -x^2, x^3, -x^4…
11 Write a program to print the value of following series: 56
sinx, sin2x, sin3x…..sinnx.
12 Write a program to print multiplication of table 57
(x*1=x).
13 Write a program to calculate power of the number 59
(x^n) without using pow() function.
14 Write a program to print the factorial of given 60
number.
15 Write a program to print all alphabets in lowercase 61
and uppercase.
16 Write a program to print all the characters between x 62
and y.
17 Write a program to print first N Natural Number of 63
Fibonacci Series.
18 Write a program to check if a given number is a prime 64
number or not.
19 Write a program to print 1-x+x^2/2!-X^3/3! + X^4/4! 65
.........X^n/n!

III
SET-4 PATTERN GENERATION IN ‘C’ PROGRAM.
1 1 66
12
123
1234
12345
2 1 67
121
12321
1234321
3 KLMNO 68
GHIJ
DEF
BC
A
4 AAAAA 69
BBBB
CCC
DD
E
5 a 70
a b
a b c
a b c d
6 71
*

**

***

****

*****

IV
7 1 72

01

101

0101

01010

8 * 73
**
***
****
9 1 75
21
321
4321
10 5 76
45
345
2345
12345
11 1 77
22
333
4444
12 1 78
121
12321
13 0 79
101
21012
3210123

V
14 4444 80
333
22
1
15 A 81
ACE
ACEGI
ACEGIKM
ACEGI
ACE
A
16 1 82
AB
123
ABCD
12345
17 1 83
AB
234
CDEF
56789
SET-5 ‘C’ PROGRAMS USING AN ARRAY
1 Write a program to read n integers and Print n 85
integers using an Array.
2 Write a program to find smallest and Largest number 87
in an array of n numbers.
3 Write a program to arrange an array of n elements in 88
ascending order.
4 Write a program to arrange an array of n elements in 90
descending order.
5 Write a program to insert value at i th location or value 92
entered by user using one dimensional array.

VI
6 Write a program to delete value at ith location or value 94
entered by User using One dimensional array.
7 Write a program to add two 3*3 matrices. If a and b 96
both are 3*3 matrices, then resultant matrix c=a+b.
8 Write a program to check whether given 3*3 matrix is 98
magic square or not.
SET-6 C PROGRAMS FOR STRING OPERATION
1 Write a program to read string from user and print 101
the length of the string.
2 Write a program to reverse a string 102
3 Write a program to check whether given string is 103
palindrome string or not
4 Write a program to read your name and output the 104
ASCII code of the first character representing your
name.
5 Write a program to print each word of the given 105
string into separate line.
6 Write a program to count no. Of words in string 106
7 Write a program to count number of occurrence of a 107
given character in a given string.
8 Write a program to count total word in text 108
9 Write a program to copy one string to another string. 109
10 Write a program to join two string. 110
SET-7 ‘C’ PROGRAMS USING FUNCTIONS
1 Write a program to find number is odd or not. 111
2 Write a program to find factorial of a given number 112
using function.
3 Write a program to generate series x, x^2, x^3………… 113
x^n.
4 Write a program to find maximum of three numbers. 114

VII
5 Write a program that computes x^y for integer x and 115
y.
6 Write a program that used user defined function 116
swap() and interchange the value of two variables
7 Write a calculator program to prepare user defined 117
function for each.
SET–8 C PROGRAM USING STRUCTURE
1 Write a program to print following quantities for all 118
the candidates. Roll number, name, marks in all
subjects, total marks, percentage, class using
structure.
2 Write a program which defines a structure called time 120
struct containing three member’s integer hour,
integer minute and integer second. Develop a
program that will assign values to the individual
members and display the time and in following form :
16:40:51
3 Write a program which defines a structure that can 122
describe a hotel. It should have members that include
the name, address, grade, average room charges and
number of rooms.
4 Write a program to read student roll no., name and 125
mathematics marks for 3 5students and prints
student name and roll no. If the marks are equal on
screen.
SET-9 PROGRAMS USING POINTERS.
1 Write a program to print the address of different data 127
type variables along with its value.
2 Write a program using a pointer to read in an array of 128
integers and print its element in reverse order.
3 Write a program that compares two integer arrays to 129
see whether they identical.

VIII
4 Write a program using pointer to sort an array in 131
ascending or descending order.
5 Write a program using pointer to copy one string to 133
another string.

IX

You might also like