Q&A Discussões
Cin/cout/cerr
0 Voto
1 Respostac++
1 Voto
3 RespostasHelp
0 Voto
3 RespostasIf-else problem
1 Voto
6 RespostasExecution time
1 Voto
1 RespostaC++ Question
3 Votos
3 RespostasTimer?
1 Voto
1 RespostaC++ Question
3 Votos
1 RespostaWhat's wrong?!
2 Votos
3 RespostasPost- cin Text?
0 Voto
3 RespostasIn 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 Votos
8 RespostasC++ help
-1 Voto
2 Respostascan 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 Voto
8 RespostasWhy it doesn't work?!
2 Votos
5 RespostasQuente hoje
Pig Latin
0 Votes
Someone can help me
0 Votes
Square Roots
0 Votes
What's wrong with this?
2 Votes
I’m new someone can help me
0 Votes
HTML community, HELP!!
0 Votes
What's doctype htMl
2 Votes
How this program executes?
0 Votes
I am a super beginner
0 Votes