मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (संगणक विज्ञान) इयत्ता १२ वी

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×