Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

cpp: parse error before `)' token

$
0
0
#include<stdio.h>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <getopt.h>
#include<cctype>
#include<iostream>

using namespace std;
int main( )
{
int counter1;
int result;
cin >> counter1;
result = myFactorial(int counter1);
cout << result << endl;

  return 0;
}




int myFactorial(int counter12)
{
if(counter12 == 1)
     return 1;
else
       {
       return (counter12 * (myFactorial(counter12-1)));
       }
}





compile error:

In function `int main()':
fact.cpp:15: parse error before `)' token


why is these code not compiling and executing properly.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>