Write a Program to accept a no & find the Factorial

#include <stdio.h>
#include <conio.h>
void main()
{
int fact=1,no;
clrscr();
printf("Enter the Number:-");
scanf("%d",&no);
ram:
fact=fact*no;
no=no-1;
if(no>1)
 goto ram;
 else
 printf(" Factorial of a no=%d",fact);
 getch();
 }

No comments:

Post a Comment

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number