C Programming Awareness and Practice
A Student Effort .... By Shshank Singhal Ajmer, Rajasthan, India
Pages
HOME
BASIC
RECURSION
ARRAY
STRINGS
CONVERSIONS
Q. Factorial of a no. ?
THE OUTPUT WOULD BE
#include<stdio.h>
#include<conio.h>
void main( )
{ clrscr( );
int f=1,i,n;
printf("Enter a number : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
f=f*i;
printf("Factorial=%d",f);
getch( );
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment