Computer Science, asked by Madhavi109, 1 year ago

what is the output of wap to accept a no and find its factorial in c++

Answers

Answered by alex57
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

Madhavi109: thanks a lot!!
alex57: ur wlcm
alex57: mark it as brailiest
Madhavi109: brailiest
alex57: yes mark my answer as brainlies
alex57: hey u will get a option to mark the answer as brainliest on the top of my answer
Similar questions