+ 1
Is this code right????
#include <iostream> using namespace std; int main() { /* this code simulates the sololearn c++ course */ cout <<"what is the output of the following code :-"; cout<<"int sum=0;\n for(int i=5 ; i>=0; i--) \n { \n sum+=i; \n} \n cout <<sum;"; int x; cin>>x; if(x==15) cout<<"\n \n \n \t \t \t correct! "; else cout<<"\n \n \n \t \t \t X wrong"; return 0; }
3 Risposte
+ 3
It is working as intended, if your input it's 15, It will say correct!
+ 1
Is it similar to sololearn c ++ course? !?!
Nahuel Ovejero
+ 1
It's, kinda :)