हिंदी

Write a program in C++ to find factorial of entered number. - Computer Science 1

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2016-2017 (March)

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×