+ 1
#include <iostream> using namespace std; int calc(int &a,int &b,int c=6) { a+=b; b-=c; c=a+b; } int main() { int calc(int,int,int); int x=2,y=3,z=4; cout<<x<<endl<<y<<endl<<z<<endl; calc(x,y,z); cout<<x<<endl<<y<<endl<<z<<endl; calc(5,6,z); cout<<x<<endl<<y<<endl<<z<<endl; return 0; }
what's wrong with the program its showing error
5 Respostas
+ 2
the calc function is declared and defined as int but returns nothing...try using void..
0
jfhwekhfkw
0
this is hard where are the answers
- 1
Remove the "int calc(int,int,int);" line. Also, "calc(5,6,z);" will give you an error since calc need variables for the first two parameters.
- 1
nope it shows error when ever I use & symbol can u show me any function having &