+ 1
What is the problem in this program??
#include <iostream> using namespace std; int main() { int num1, num2; cout<<"Enter the value of num1"<<endl; cin>>num1; cout<<"Enter the value of num2"<<endl; cin<<num2; cout<<"the sum is"<<num1+num2; return 0; }
11 odpowiedzi
+ 10
cin>>num2 instead of cin<<num2
+ 6
Haram Abbas
It doesn't give error, I already checked it.
+ 2
on line 9 :- write cin>>num2; not cin<<num2;
+ 2
Haram Abbas
make a new variable sum and put sum of num1 and num2 and than print it
eg:-
int sum= num1+num2;
cout<<"Sum : "<<sum;
+ 1
I write but still giving error
+ 1
https://code.sololearn.com/crdyP451Jw4b/?ref=app
Updated
You write cin>>num2 Instead of cin<<num2
0
Ok Thanks
0
#include <iostream>
using namespace std;
int main()
int n=9;
if(n%2==0);
{
cout<<"Even number";
}
else
{
cout<<"odd number";
return 0;
}
0
What is problem
0
Replace cin<<num2 with cin>>num2
0
Ok I got it
Thank you