what is the output of wap to accept a no and find its factorial in c++
Answers
Answered by
1
Well it is upto the coding but i can give u a idea of this
OUTPUT:
Type a number
5
the factorial of 5 is
120
an idea of input
main( )
{
int n, i, fact;
cout<<"Type a number";
cin>>n
cout<<"the factorial of <<n<< "is";
for(i=1 , i<=n , i++)
{
fact = fact*i;
}
cout<<fact;
return(0);
}
if it helps mark as brainliest
OUTPUT:
Type a number
5
the factorial of 5 is
120
an idea of input
main( )
{
int n, i, fact;
cout<<"Type a number";
cin>>n
cout<<"the factorial of <<n<< "is";
for(i=1 , i<=n , i++)
{
fact = fact*i;
}
cout<<fact;
return(0);
}
if it helps mark as brainliest
Madhavi109:
thanks a lot!!
Similar questions