You are on page 1of 3

PROGRAM CODING #include<stdio.h> #include<conio.

h> void main() { int i=0,f1=0,f2=1,f3,n; clrscr(); printf("Enter the limit of the series: "); scanf("%d",&n); printf("%d\n%d",f1,f2); do { f3=f1+f2; f1=f2; f2=f3; i++; printf("\n%d",f3); }while(i<n); getch(); }

OUTPUT: Enter the limit of the series: 6 0 1 1 2 3 5 8 13

PROGRAM CODING

#include<stdio.h> #include<conio.h> void main() { int n=1,p,r,q,s,u; clrscr(); while(n<1000) { p=n%10; q=n/10; r=q%10; s=q/10; u=(p*p*p)+(r*r*r)+(s*s*s); if(n==u) printf("\n%d",u); n++; } getch(); }

OUTPUT: 1 153 370 371 407

PROGRAM CODING

#include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("Enter the three numbers: scanf("%d%d%d",&a,&b,&c); if(a>b) { if(a>c) { printf("%d is the greatest among } } else if(b>c) { printf("%d is the greatest among } else { printf("%d is the greatest among } getch(); }

");

the three numbers",a);

the three numbers",b);

the three numbers",c);

OUTPUT: Enter the three numbers: 2 4 8 8 is the greatest among the three numbers

You might also like