/*WAP to calculat factorial using "WHILE" loop"*/
#include<stdio.h> #include<conio.h> void main() { int n,i=1,fact=1; clrscr(); printf("enter no."); scanf("%d",&n); while(i<=n) { fact=fact*i; i++; } printf("%d",fact); getch(); }
there is some good c ,java, sql and vb6 programs,Windows tricks, sms shorthand etc
#include<stdio.h> #include<conio.h> void main() { int n,i=1,fact=1; clrscr(); printf("enter no."); scanf("%d",&n); while(i<=n) { fact=fact*i; i++; } printf("%d",fact); getch(); }
No comments:
Post a Comment