Friday, June 4, 2021

program find factorial of the number using for loop (POP) (132)

 #include<iostream>

using namespace std;

int main()

{

int i,num,f=1;

cout<<"please enter your number:";

cin>>num;

for(i=1;i<=num; i++)

{

f=f*i;

}

cout<<"the factorial of the number is:"<<f<<endl;

}

No comments:

Post a Comment