0
I am unable to run programme. Whenever I click to run a message appear to my screen and I am unable to understand that message.
It ask about the line or any thing to enter which is far away to understand by me. Kindly tell me .
6 Answers
+ 2
If it is talking about line numbers, you likely have errors in your program.
+ 2
You can't set sum to a+b when you declare it, because at this point, a and b hold no value.
Set sum to a+b AFTER the user has input them.
#include <iostream>
using namespace std;
int main();
{
int a, b, sum;
cout<<"enter a no";
cin>>a;
cout<<"enter second no.";
cin>>b;
sum = a + b;
cout<<"sum";
return 0;
}
+ 1
thank you
0
#include <iostream>
using namespace std;
int main();
{
int a,b,sum=a+b;
cout<<"enter a no";
cin>>a;
cout<<"enter second no.";
cin>>b;
cout<<"sum";
return 0;
}.........
0
kindly tell me error
0
split multiple input into separate lines......this is the message which is coming on screen after clicking on run