+ 1
Hello can you please help me find the error.......it is a program to find the factorial of a number.
#include<iostream> using namespace std; int main() { int num,factorial =1; cout<<"Enter a number to find it's factorial :"; cin>>num; for(int x=1;x<=num;x+++) { factorial=factorial*x; } cout<<"The factorial of the number is :"<<factorial<<endl; return 0;
1 Answer
+ 1
Last line:
close missing curly bracket
In for loop:
Increment statement you put x+++ instead of x++