×
Don’t stop when you’re tired. STOP when you are DONE.

# Lab Manuals for C Language - C By Umesh Kumar

• C Language - C
• Practical
• Guru Ghasidas Viswavidhyalaya - GGV
• Master of Computer Applications
• 766 Views
Umesh Kumar
0 User(s)

#### Text from page-1

MCA I SEMETER LAB BOOK ON Programming language in c MCA I YEAR I SEMETER (SUBCOD-103) Mr. UMESH KUMAR, MCA DEPARTMENT OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY GURU GHASIDAS VISHWAVIDYALAY,BILASPUR BILASPUR, (C.G), KONI, CHHATTISAGARH 495009

#### Text from page-2

1. Write a program to reverse any integer number. #include<stdio.h> #include<conio.h> void main() { int n,rev =0; clrscr(); printf("Enter Any set of Number \n"); scanf("%d",&n); while(n!=0) { rev = rev * 10; rev = rev + n % 10; n=n/10; } printf("Reverse Number is = %d",rev); getch(); } 2. Write a program to display sum of digit of any given integer. (Eg. 1234, 1+2+3+4 output = 10 ) #include<stdio.h> #include<conio.h> void main() { int i,n,b,sum=0; clrscr(); printf("Enter any Number \n"); scanf("%d",&n); while(n>0) { b = n%10; sum = sum+b; n=n/10; } printf(" Sum of Digit =%d",sum); getch(); }

#### Text from page-3

3. Write Fibonacci Series till 15. (0,1,1,2,3,5,8,13). #include<stdio.h> #include<conio.h> void main() { int n,a,b,c; n=15;//upper limit clrscr(); a=0; b=1; c=a+b; while(c<=n) { printf("%3d",c); c=a+b; a=b; b=c; } getch(); } 3. Write a program to print largest no. out of 3 no.(Using nested if statement). #include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("\n Enter Three Number \n"); scanf("%d%d%d",&a,&b,&c); if(a>b && a>c) { printf(" A is largest number"); } else if(b>c && b>a) { printf("B is largest Number"); }

#### Text from page-4

else if(c>b & c>a) { printf("\n C is largest number"); } else { printf("\n if big no eque show but not show smaller no"); } getch(); } 5. Write a program to check given no. is palindrome or not (User will enter no.). #include<stdio.h> #include<conio.h> void main() { long int n,r,b,rev; clrscr(); printf("Enter any Number::"); scanf("%ld",&n); b=n; rev=0; while(n!=0) { r=n%10; rev=rev*10+r; n=n/10; } printf("Reverse Number is =%d",rev); if(rev==b) printf("Its Polindrome Number"); else printf("Its not Polindrome Number"); getch(); }