Discussions Q&R
c++
1 Vote
3 RéponsesHelp
0 Vote
3 RéponsesExecution time
1 Vote
1 RéponseIf-else problem
1 Vote
6 RéponsesC++ Question
3 Votes
3 RéponsesC++ Question
3 Votes
1 RéponseWhat's wrong?!
2 Votes
3 RéponsesPost- cin Text?
0 Vote
3 RéponsesC++ help
-1 Vote
2 RéponsesIn the code below the output is 2. This code is used in a challenge and I get an error when I select the answer 2. It accepts as correct the answer 1 which I believe is wrong. If you agree please thumbs up.
If you find any other errors please post them here!
#include <iostream>
using namespace std;
int main()
{
for(int i=1; i>=1; i++) {
if(i<1 || i>1){
cout << i;
break;
}
}
return 0;
}
8 Votes
8 RéponsesWhy it doesn't work?!
2 Votes
5 Réponsescan anyone plz explain me this program step by step?#include <iostream>
using namespace std;
class MyClass {
public:
int var;
MyClass() { }
MyClass(int a)
: var(a) { }
MyClass operator+(MyClass &obj) {
MyClass res;
res.var= this->var+obj.var;
return res;
}
};
int main() {
MyClass obj1(12), obj2(55);
MyClass res = obj1+obj2;
cout << res.var;
}I am not getting the part inside operator+
0 Vote
8 RéponsesAujourd'hui en vedette
Hi help me I am new
2 Votes
How do I solve all test cases for popsicles problem?https://www.sololearn.com/coach/3?ref=app
0 Votes
Where did mess up....
1 Votes
Where can I learn c#
0 Votes
Feedback on my portfolio
0 Votes
Yo this is madness
0 Votes