1.

किसी संख्या का फैक्टोरियल निकालने हेतु C++ में प्रोग्राम लिखिए। 

Answer»

#include<iostream.h>
void main( )
int num, i, f = 1;
cout<<"Enter the number:";
cin>>num;
for(i = num; i > 0; i--)
{
f=f*i;
}
cout<<"Factorial of the number:"<<f;
}

आउटपुट:

Enter the number: 5
Factorial of the number : 120



Discussion

No Comment Found