Top Banner

Click here to load reader

C- Practical File

Apr 21, 2015

ReportDownload

Documents

C-LANGUAGE PROJECT FILE

INDEXPARTICULAR T.SIGN1WAP TO ADD TWO VARIABLES 2WAP TO PRINT STARS ON SCREEN 3WAP TO FIND THE FACTORIAL OF THE NUMBER 4WAP TO FIND IF NUMBER=10 THEN GOOD ELSE BAD 5WAP TO PRINT FABBONIC SERIES FROM 1 TO 55 6WAP TO PRINT ODD NUMBERS FROM 1 TO 20 7WAP TO FIND THAT NUMBER IS PRIME OR NOT (7,11,13,17,19 ETC.) 8WAP TO FIND THAT NUMBER IS PALINDROME OR NOT (121=121) 9WAP TO CONVERT CELSIUS TO FAHRENHEIT 10WAP TO FIND OUT TOTAL MARKS & PERCENTAGE OF THREE SUBJECTS .11WAP TO FIND OUT BIGGER NUMBER (IF-ELSE) 12WAP TO DISPLAY 5 STUDENTS MARKS AND THEIR DIVISION 13WAP TO SHOW IF-ELSE 14WAP TO CALCULATE SI FOR THREE SETS OF VALUES. 15WAP TO SUM, SUBTRACT, MULTIPLY & DIVISION OF TWO NUMBERS (5 VARIABLES) 16WAP TO FIND OUT A NUMBER IS EVEN OR ODD

17WAP TO DISPLAY AVERAGE OF TWO NUMBERS

P.1WAP TO ADD TWO VARIABLES#include #include void main () { int a,b,c; clrscr(); printf ("Enter A: "); scanf ("%d",&a); printf ("Enter B: "); scanf ("%d",&b); c=a+b; printf ("\nSum is %d",c); getch (); }

Output

P.2WAP TO PRINT STARS ON SCREEN#include #include void main () { int i,j; clrscr(); for (j=1;j= 50 ) printf(Second Division); else { if( percent >= 40) printf(Third Division); else printf(Fail); } } }

P.13WAP TO SHOW IF-ELSE#include #include void main() { int i; printf(Enter either 1 or 2.); scanf(%d, &i); if( i == 1) printf(You would go to heaven.); else

{

if( i == 2 ) printf(Hell was created with you in mind.); else printf(How about the earth.);

} }

P.14WAP TO CALCULATE SI FOR THREE SETS OF VALUES.#include #include void main() { int p, n, count; float r, si; clrscr(); for( count = 1; count -1); return 0; } int Average(int i) { static int sum = 0, count = 0; sum = sum + i; count++; return sum / count; }

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.