For Loop Factorial Question
Factorial of a number Question:- Remya is studying in 10th std and she was not good at maths. Her maths teacher asked to find a factorial of the given number. Can you help Remya by writing a program for the same. Input Format: The input consist of an integer Output Format: Print the factorial of a number which denotes an integer Sample Input: 5 Sample Output: 120 Answer #include<iostream> int main() { int a,i,b = 1; std::cin>>a; for ( i=1 ; a >=i ; i++) { b = i*b; } std::cout<<b; }