Find Syntax error in the program and rewrite program

Okay i am sorry at first place for putting question i know all of your time is valuable here please answer this question i got......... i know i should consider learning rather then asking but i dont have that much time like after 8hrs i have to submit the entire project and i got only one question left witch is this and \ i have taken pic of question so it would be more clear http://imgur.com/N47uNOE
To find the syntax error you can type the code into the website at http://cpp.sh and it will run a compiler for you and report any syntax errors.

as for rewriting it, why no just remove the Callfunc() and do it all in main()
can i you wright the whole structure of program i am sorry but i am really noob with this thing plz you would do great favor and release great burden from me
1
2
3
#include <iostream>
#include <programerror>
int main(){std::cout<<"30204020";}
i dont understand Zhuge
@Zhuge
I tried your solution and after fixing one semantic error it worked a treat :)

@aryan
Sorry, no, i wont do your homework for you.
Last edited on
hey i am sorry i feel good that you dont wanna do so here i have come up with my fix tell me if its right @Jaybob66

#include <iostream>
using namespace std;
void callfunc(int Arg1,int Arg2){
Arg1 += Arg2;
cout << Arg1 << Arg2;
}

int main(){
int x=10,y=20;
callfunc(x,y);
return 0;
}
Thats great Aryan403, you fixed the syntax errors :)

but your program outputs "3020" and that isnt the same as the original program.

you need to tweak it so it outputs "30204020" which is what the original program was trying to do.

Zhuge's answer was a bit cheeky but the output was correct, so the program does the same thing as the original.

So thats the last bit to finish,
my original response to you was
why no just remove the Callfunc() and do it all in main()
which is still valid. It means instead of calling callfunc() do the math and the output all in main and get rid of the function.


Last edited on
Topic archived. No new replies allowed.