Sei sulla pagina 1di 3

List of C programs

Operators,data types.
Write a C Program to display "Hello World" on screen.
Write a C Program to display your name and address in different lines.
(1)Write a C program to calculate sum of two integers numbers and print it.
(2)Write a C Program to display square and cube of a number.
(3)Write a C Program to find area of circle.
(4)Write a C Program to interchange values of two number using third variable.
(5)Write a C Program to interchange values of two number without using third var
iable.
(6)Write a C Program to convert Km value into meter value.
(8)Write a C Program to input all marks of all the subjects and display total an
d percentage.
(9)Write a C Program to input quantity and price of an item and display total Rs
. on screen. Also input discount (%) and display final payment R
s. on screen.
(10)Write a C Program to input total selling of salesman and calculate 25% c
ommission on selling and display it.
(13) Write a C Program to accept any character from user and display its ASCII n
umber on screen.4
(14) Write a C Program to input any ASCII number and display appropriate charact
er on screen.
(15) Write a C Program to find area of a rectangle ( Hint : A = l*b)
(16) Write a C Program to find area of a triangle (Hint : A = ½ *h*b)
(19) Write a C Program to input three digits number from user and calculate sum
of first and last numbers.
(Hint : I/p :358 O/p :11)
(21) Write a C Program to convert Celsius value into Fahrenheitvalue. ( Formula
: F= C X 9/5 +32)
(22) Write a C Program to convert Fahrenheit value into Celsius value.( Formula
: C= (F-32) X 5/9)
(24) Write a C Program to input two digits number from user and display reverse
of that number on screen
(Hint : I/P : 32 O/P : 23)

? conditional statement programs


(1) Write a C Program to check whether the enter number is odd or even.
(2) Write a C Program to display greatest of three numbers.
(3) Write a C Program to input any Capital letter and display it with small lett
er.
(4) Write a C Program to input any Small letter and display it with capital lett
er.
(4) Write a C Program to accepts marks of all the subjects and display total mar
ks, percentage, class and result whether the
student is pass or fail. (Passing mark is 40) .
(5) Write a C Program to check whether the enter year is leap year or not.
(6) Write a C Program to input price, quantity of an item from user and display
final payment according to following condition.
a. If total purchase is greater than 1000Rs. then calculate discount 15% oth
erwise calculate 10% of total rs.
(7) Write a C Program to input two number from keyboard and check whether the fi
rst number is divisible by second number.
(8) Writer a C Program to enter any character from user and if that character is
capital letter then display it with small letter on screen and if enter
character is small letter then display with Capital letter.
(9)Write a C Program to input any value from user and check that the enter value
is Capital letter, Small letter, digit or special symbol.
(10) write a program that accepts three sides of a triangle and print whether th
ey form a triangle or not
(11)write a program that accepts coefficients of a general quadratic equation, f
ind the nature of roots and print the roots if real. ax2 +bx +c =0, calcu
late p=(b2 4ac).
(12)To convert seconds into hours,minutes and seconds and vice-versa
(13)To convert days into years,months and days and vice-versa
(14)Display three numbers in ascending order using if-else statement.
(15)If cost price and selling price of an item is input through the keyboard, wr
ite a program to determine whether the seller has made profit or incurred l
oss. Also determine how much profit he made or loss he incurred.
(16)Write a program to calculate income tax of an employee. If the income is upt
o Rs. 60,000/-, then tax is zero. If the income is upto Rs. 80,000/- then
the tax is 15% of the amount that is greater than Rs. 60,000/-. If the amount i
s greater than Rs.80,000/-, then the tax is on Rs. 80,000/- plus 20% of the
amount that is greater than Rs. 80,000/-
(17).Calculate electric bill depending the following conditions Consumption Unit
s
Rate of Charge
0.200 Rs 0.50 per unit
201.400 Rs 100 plus Rs.0.65 per unit excess of 200
401.600 Rs. 230 plus Rs.0.80 per unit excess of 400
601 and above Rs. 390 plus Rs.1.00 per unit excess of 600

control statements
(1)Print first N numbers
(2)sum of first N numbers
(3)print first N even or odd numbers
(4)print even or odd numbers within a given range
(5)factorial of a number
(6)fabonacci series
(7)gcd & lcm of two numbers
(8)prime or not
(9)generate first N prime numbers.
(10)reverse a given number.
(11)add all the digits of a given number(ex:12345 sum=15).
(12)To find whether given number is power of 2 or not.
(13)wAP to count the number of ones in a given integer
example:
(14)To convert 2 digit number to word. e.g.i/p : 45o/p :forty five.
(15)Write a C program to print all Armstrong numbers between 1 to1000. (e
x: 135= 1^3 + 3^3 + 5^3).
(16)Write a C program to print all Combinations of characters A, B, C.
(17)Write a C program to find the factors of a given number.
(18)Write a C program to find the prime factors of a given number.
(19)Convert decimail nos to roman equivalent upto 2000 and vice-versa
(20)write a program to add even digits of a given number
example : 13462 output: 4+6+2=12
ARRAYS
1.wap to read and print N numbers.
2.TO calculate average of N numbers.
3.To count the no of Even and Odd numbers.
4.To print larger and smaller elements of an array
5.To count the occurance of the given number.
6.Ascending/Descending order
7.To find binary equivalent of the number and also of bits in it.
eg: Num = 8 binary : 1000 number of bits=4;
8.Write a C program to delete an element from the 'n' position of an array.
9.Write a C program to Insert an element at the 'n' th position
10.Write a C program read a sequence of positive integers and store it in an arr
ay, then read an integer N, and then rotate clockwise the content of the arr
ay a corresponding number of positions and print resultant array.
For example, if the sequence was 1,2,3,4,5
and the number 3 is entered, the array becomes 3,4,5,1,2

STRINGS
1.WAP to read and print your name using gets() and puts() functions.
2.Implement all the string instructions
a>strlen
b>strcpy , strncpy
c>strcmp , strncmp
d>strcat , strncat
3.check whether a given string is palindrome or not
4.count the number of vowels in a given string
5.WAP to read a string and print the count of all the characters.
example : good morning
output : g=2 o=3 d=1 m=1 r=1 n=2 i=1.
6.WAP to check whether a given sub string is present in the main string.
7.write a program that accepts name and prints its short form.
example : amal krishna roy
output : a k roy
8.WAP to read a string and print all the words in reverse order
example: good morning india
output : india morning good

Potrebbero piacerti anche