0
What's wrong with this code?!
#include <iostream> using namespace std; int print() {cout<< "print output" << endl;} int result(int a,int b) int main() { print(); result(5,6); return: 0; } // Function definition int result(int a,int b) { cout<< a + b; }
6 Réponses
+ 4
1) missing semicolon (;) right after result function declaration (just above main)
2) extra (:) between return and 0 at the end of the main() function
+ 3
Fixed:
#include <iostream>
using namespace std;
int print() {
cout<< "print output" << endl;
}
int result(int a,int b);
int main(){
print();
result(5,6);
return 0;
}
// Function definition
int result(int a,int b) {
cout<< a + b;
}
+ 2
No problem, were always here to help
0
Thanks! 😊 Defaulting proved to be a hard task! (I'm sorry for my English.. )
0
can some one give me a start point on prigramming using C++
0
Leonard, what do you mean?