#include<stdio.h> #include<conio.h> void main() { clrscr(); int i,fact=1,n; printf(“enter the number”); scanf(“%d”,&n); for(i=1;i<=n;i++) { fact=fact*i; } printf(“the factorial of thee number is %d”,fact); getch(); }
Category: C Programming
C Program to Print Table of any Number
#include<stdio.h> #include<conio.h> void main () { clrscr(); int i,n,c; printf(“Enter the number”); scanf(“%d”, &n); for(i=1;i<=10;i++){ c=n*i; printf(“%dX%d=%d \n”,n,i,c ); } getch(); }
C Program to Print Fibonacci Series | O Level Examination
#include<conio.h> #include<stdio.h> void main() { int prev,next,sum,n,i; prev=next=1; for(i=1;i<=10;i++) { printf(“%d,\t”,prev); sum=prev+next; prev=next; next=sum; } getch(); }
C Program to design Stop Watch (Clock)
#include<stdio.h> #include<conio.h> #include<dos.h> void main(){ int i,j,k; for(i=0;i<=24;i++){ for (j=0;j<=60;j++){ for(k=0;k<=60;k++){ printf(“%d:%d:%d”,i,j,k); delay(1000); clrscr(); } } } getch(); }
C Program to Convert Decimal number to binary number
#include<stdio.h> #include<conio.h> void main() { int num,b,bnum; printf(“Enter a Number “); scanf(“%d”,&num); while(num>0) { b=num%2; num=num/2; bnum=b; printf(“%d”, bnum); } getch(); }