- 1
can any one tell
they that tray u are self like this #include <iostream> using namespace std; int; () { int << A =10; int << b = 30; sum>> a+b return 0; } so then i click on start and they saying some thing error and not anwseeing me
4 Answers
+ 1
ok
0
what is this "int;()"... if it is a function remmove ; from it i.e int()... in that case it will always return zero...if u are making a function for sum...name it as sum and return sum at last...
0
like this
#include <iostream>
using namespace std;
sum ()
{
int << a =10;
int << b = 30;
int sum>> a+b
return sum;
}
0
or if you want to pass arguments :
sum (int a, int b)
{
int sum>> a+b
cout<<"the sum is:"<<sum
return sum;
}
sum(1,2) will give 3 as output