- 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; */
3 Antworten
+ 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;
}
+ 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;
}
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.