- 1

Yet another issue with these BS challenges...

#include <iostream> using namespace std; int main() { int a; int b; // your code goes here int sum; cout << "enter a number \n"; cin >> a; cout << "another one \n"; cin >> b; sum = a + b; cout << "sum is: " << sum << endl; return 0; } /* i literally just copied the sample below, but it's not working. whats the god damn issue now? int a, b; int sum; cout << "Enter a number \n"; cin >> a; cout << "Enter another number \n"; cin >> b; sum = a + b; cout << "Sum is: " << sum << endl; */

3rd Oct 2020, 8:20 AM
Sasquatch6ft40
3 Respuestas
+ 4
Solution (you are attempting) requires you to output only sum so comment out every thing else #include <iostream> using namespace std; int main() { int a, b; int sum; //cout << "Enter a number \n"; cin >> a; //cout << "Enter another number \n"; cin >> b; sum = a + b; cout << /*"Sum is: " <<*/ sum << endl; return 0; }
3rd Oct 2020, 8:49 AM
Daljeet Singh
Daljeet Singh - avatar
+ 6
Your code is woRkiNg and giving proper Outputs check it again and if u compiling your code on solo then give both input at run time #include <iostream> using namespace std; int main() { int a; int b; // your code goes here int sum; cout << "enter a number \n"; cin >> a; cout << "another one \n"; cin >> b; cout<<"Entered value of a is="<<a<<endl<<"and b is ="<<b<<endl; sum = a + b; cout << "sum is: " << sum << endl; return 0; }
3rd Oct 2020, 8:42 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
that did it, but i dont understand why they keep offering up challenges that include things you havent learned, or the exact opposite of what you just learned. this app acts like an angry college professor trying to trick you into failing, and its extremely aggrivating.
3rd Oct 2020, 8:56 AM
Sasquatch6ft40