Professional Documents
Culture Documents
Programming Coding
Programming Coding
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(); }
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(); }
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(); }
");
OUTPUT: Enter the three numbers: 2 4 8 8 is the greatest among the three numbers