Q&A Discussies
c++
1 Stem
3 AntwoordenHelp
0 Stemmen
3 Antwoordenhow to use c++to output Chinese
0 Stemmen
3 AntwoordenNo output in my code???
0 Stemmen
3 AntwoordenExecution time
1 Stem
1 AntwoordIf-else problem
1 Stem
6 AntwoordenC++ Question
3 Stemmen
3 AntwoordenTimer?
1 Stem
1 AntwoordC++ Question
3 Stemmen
1 AntwoordWhat is wrong with this
0 Stemmen
2 AntwoordenHow can declare a word?
0 Stemmen
2 AntwoordenWhat's wrong?!
2 Stemmen
3 AntwoordenPost- cin Text?
0 Stemmen
3 AntwoordenC++ help
-1 Stem
2 AntwoordenIn 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 Stemmen
8 AntwoordenWhy it doesn't work?!
2 Stemmen
5 Antwoordencan 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 Stemmen
8 AntwoordenPopulair vandaag
Decorators in python.
2 Votes
Coding for Cybersecurity
1 Votes
Need help
1 Votes
Pointers in c#
1 Votes
Please click me
0 Votes
Salut tout le monde
1 Votes
How can i isntall modules
1 Votes
Unity's loading time?
4 Votes