Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed why this code give me inncorrect answer..??

+9 votes
asked May 7, 2021 by Yousef Nino (190 points)
closed Sep 28, 2021 by Admin
#include <iostream>

using namespace std;

int main()

{

int a ;

int b ;

int c ;

//the rule of the operation

c = a + (2*b) ;

// the code

cout<< "enter the value of (a) number \n " ;

cin>> a ;

cout<< "enter the value of (b) number \n " ;

cin>> b ;

cout<< "the value of (c) nwmber equal"<< c<<"\n" ;

}
closed with the note: answered

12 Answers

0 votes
answered Jun 1, 2021 by ALBIN ANTONY (140 points)
#include <iostream>

using namespace std;

int main()

{

int a,b,c=0,d=0;

//c=a+(2*b);

// the code

cout<< "enter the value of (a) number \n ";

cin>>a;

cout<< "enter the value of (b) number \n ";

cin>> b ;

d=2*b;

c=a+d;

cout<<"the value of (c) nwmber equal"<<c<<"\n";

return 0;

}
0 votes
answered Sep 10, 2021 by Lone Wolf (140 points)

#include <iostream>

using namespace std;

int main()

{

int a ;

int b ;

int c ;


// the code

cout<< "enter the value of (a) number \n " ;

cin>> a ;

cout<< "enter the value of (b) number \n " ;

cin>> b ;

cout<< "the value of (c) nwmber equal"<< c<<"\n" ;


//the rule of the operation

c = a + (2*b) ;
return 0;
}

//Error Was That You Cannot Perform Mathmatical Terms Before Given Values

 
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...