Вы находитесь на странице: 1из 3

programs for practice in C

simpal programs
.input a radius from a user & print the area of the circle( ) & circumference ( ) of circle(1
.input the value in fahrenheit use the formula C=(F- 32 ) 5 /9 & convert that into centigrader(2
.input three values from user & print the sum of these three values(3
.write a program to add five numbers using scanf statement(4
.write a program to find out the total expenses of a firm by the formula(5
.Total expenses=bills+rent+marketing+misc
write a program to input principal,rate,& time & calculate interest by the formula(6
.I=(PRT)/100.print the input values & result on screen
write the program to read the values of A,B,C,D,E & calculate X by the formula(7
.X=A3+B2+C+D/E
write prog which input your data of birth in the form of years,months ,days & then convert into second(8
write a program to input the names & weightes three things purchased(i.e Mangose,5kg,sugar2kg, etc)&(9
.print their names & weight on screen
.(write a program add two numbers & find out their square by the formula.(a+b(10
.(write a pro to input two numbers find out their difference & squre of diffrence by the formula.(a-b(11
.write a pro to get the values vf,vi,a,t& solve the following equation.vf=vi+at(12
write a pro to get the values a,s,vf,vi, & solve the following equation (13
.2as=vf-vi
write a program who get values of length of triangle's sides by user & show area of triangle by using this(14
formula area = A= s(s-a)(s-b)(s-c) wher s=a+b+c/2
if statement programs
if year is leap year it is divisibal by 4,except that any year divisible by 100 is a leap year if it is divisibal(15
.by 400.take year input & check it is leap year or not
write a pro that input x& y co-ordinates of a point in the coordinate plane & determine the location of(16
.point
.get a number from user & find it square,cube ,or square root on user choice using if-else statement(17

write a program which takes the roll no of 50 students,calculates their results & print name of pass & fail(18
.students on screen
input hour & minutes convert into minuts(19
.input hour & minutes convert into hours (20
.input seconds & convert into hour ,minute,seconds(21
.input feet & inches convert into feet(22
input feet & inches convert into inches (23
.write a program which get input Rs1,pasa1,Rs2,pasa2 & subtract two cash amounts(24
.write a program which get input Rs1,pasa1,Rs2,pasa2 & add two cash amounts (25
.write a program which get input feet1,inches1,feet2.inches2 & subtract two lentgh(26
.write a program which get input feet1,inches1,feet2.inches2 & add two lentgh (27

.write a program to get an ASCII code & print the equivalent character(28

.progarm write a program which input a numaric number & print its reverse(29
=write a pro to solve the quadratic equation.program takes the value a,b,c & uses this formula to solveX(30
.
write a program which input dates(the current year,month,days,hours,& seconds (birth year(31
.(.month,days ,hour,seconds) & the tell your age in (year,month,days,hours & seconds
.write a program which input a number from user & print its modulus value(32
write a pro,which input temperature(centigrade) from user & print the output according to this criteria(33
if temp below than 45 it is very hot
if temp below thwn 30 it is hot
if temp below 20 it is normal
if temp below than 10 it is pleasant
else cold
write a prog which get input in Rs & passa & convert it in Rs & convert it in passa 35)reverse of above(34
.question
take three inputs hour,m,seconds & convert it into seconds(36
.reverse of above program(37
.print even or odd number while getting input from user(38
.write a program to accept three numbers & print the smallest number on secreen(39
.write a program to calculte electricity bill(40
units rate=Rs.0.75 100
above 100 units rate=Rs.1.75
above 200 units rate=Rs=2.25
write a prog to get per year income of a person .if income is more than 40000 then after deducting 2.5%(41
.zakat find 10% tax on remaining amount
write a program which get four numbers from user & shows the gratest number using only if-else(42
.statement
.write a program which get month number from user & shows that how many days in this month(43
.write a program that input two numbers & find if second number is square of first number(44
write a program that input salary grads.it add 50% bonus if the grade is grater than 45.it add 25% bonus(45
.if the grade is 15 or less than
write a program which get two floating point number from user & get user decision for +,-,*,/ if user(46
.wants to divide number by user than show math error
.Q)write a program which get input from user in numeric 0 to 9 corresponding word
Switch statment
write a program that input a radius.it calculates the area of circle if user enter 1 as choice.it calculates(47
.circumference if the user enter 2 as choice
.write a program that get numbers of days of week and show name of day using switch statement(48
.write a program which get two numbers & find out number is even or odd (49
.write a program which get two numbers & find out number is positive or negative (50
For loop/while/do while
.write a program which scroll your name on screen (51
write a program which print your name in a box.your program consist of two function (horizantal line &(52
.(vertical line
.write a program which print the graph of 11 batsman score(53
.(draw the box & print your name.(using gotoxy & for loop(54
.write a program to display ten numbers in descending order(55
.write a pro to comput the product of first ten odd integers(56
.write a program to calculate these numbers 0,1,2,3,……,100 with while loop(57
.write a program to find the sum of 1/2.1/3,1/4,…,1/20 with while loop(58
.progarm to accept any value and draw a table on the screen(59
write a pro that use while loop to enter a number from user & shows it the loop is terminated when (-1) is(60
.entered by user
write a progra that get two numbers from user & display the result of first number raise the power of(61
.second number using do while loop
write a program that get starting and ending point from user and display all odd numbers in given range(62
.using do while loop
.write a pro that display following the shape(63
*********
********
*******
******
*****
****
.write a program to accept any value & draw a table on the screen(64
.to print & find the sum of 10 natural numbers (1+2+3+….)using loop(65
write a program using do-while loop that repeatedly prompts & takes input untill a value in the range 0 to(66
.15 is input.this program should add the values before exiting the loop & displays their sum

Function
write a program that call two function draw_horizontal & draw _vertical to construct a rectangle.also(67
.write function draw horizanta to draw parallel horizontal lines & draw vertical to draw vertical lines
.write a program that gets two points (x1,y1) & (x2,y2) display the distance formula in a function(68
.write a function is prime that input a number & return 1 if number is prime othervise return 0(69
.write a program that prompts the user to enter a number & then reverse it through function(70

convert the program,which print any table.program input three values (table no,starting value,ending(71
.value) pass these values to the function & print the table according to these value
write a program which input an integer no from user if no,is greater than 32767 it displays an error(72
message & then again input the number.if number is according to desire length 32767 then
print reverse of this no
sum all the numeric number
find greatest no
find smallest no
write a program which input two values (1-day,two-month) from user & print star according to date of(73
.birth
write a program which input numeric from 0to9 & prints its corresponding values.eg entering-1 show(74
.one
pro which input any keyboard character & program either it is alfa ,numaric,arithmetic(75
.operator,brackets.vowel,or other character
.write a program to find the smallest values by using logical operator(76
Function with return
write a program to get a number from 1 to 5 return either the number is less than 2, equal to 2 or greater(77
.than 2
.write a program to get number & return table of the number from 1 to 10 using GOTO command(78
Array
.input array elements & sorting of an array(79
.input array elements & find largest number in an array (80
.write a program to define an array to accept ten numbers from keyboard & print them in descending(81
.write a program to raed ten n0umbers in any array & print the everage(81
write a programm to accept 15 numbers from the keyboard,make array & print them descending order(82
.write a program to get name of any person & return total number of characters in the name(83
write a program which input four digit number in an array (as character) then print the numaric values in(84
.words (challenge Q) ..eg input 1,2,3,4, & output one thousand & thirty four
write a program which swap the value of two variables, (hint:let a,b are two variables so we have to show(85
.'value of 'a' in'b' & value of 'b' in variable 'a
write a program to get string consisting on alphabet , "t" & few other alphabets from keyboard & return(86
.that how many times 't' occurred

.write a pro to get an alphabet return its ASCII code(87


.write a program which print the first prime number(88
.write a program which add two matrix(89
.write a program which get numaric value & convert to binary number(90
.write a program which print the highest value of an array(91
write a pro which print the second highest value of an array(92
.write a program which input an array & sum all the value of an array(93
.write a program which input an array & print it in reverse order(94
.write a program which print even & odd number of array(95
.write a program which input array & sum all even & odd values separately(96

Вам также может понравиться