Advertisements
Advertisements
प्रश्न
Write a program in C++ to find factorial of entered number.
टीपा लिहा
उत्तर
//Program to find factorial of a number
#include<iostream.h>
#include<<conio.h>
void main ( )
{
int fact, number, i;
clrscr ( ) ;
fact = 1;
cout << “Enter the number” <<endl;
cin >> number;
for (i = 1; i < = number; i++)
{
fact = fact*i;
}
cout<< “The factorial of a inputted number is” <<fact;
}
shaalaa.com
C++ Programming
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?