+ 1

excuse me. help me to how coding( use looping for )this output 10 + 8 + 6 + 4 + 2 = 30 10 + 8 + 6 + 4 = 28 10 + 8 + 6 = 24 10 + 8 = 18 10 = 10 ======= + 110

8th Jan 2017, 11:09 AM
Rina Mirushita
Rina Mirushita - avatar
12 ответов
+ 9
# include <iostream> using namespace std; int main () { cout <<"10+8+6+4+2=30" <<endl; cout <<"10+8+6+4=28"<<endl; cout <<"10+8+6=24 "<<endl; cout <<"10+8=18"<<endl; cout <<"10=10"<<endl; cout <<" ======+"<< endl; cout <<" 110"<<endl; return0 }
8th Jan 2017, 11:18 AM
Dinu
Dinu - avatar
+ 8
@Dinu Cuz you missed out on utilising for loops but nice try anyways lol
8th Jan 2017, 12:36 PM
Hatsy Rei
Hatsy Rei - avatar
+ 7
@Dinu your answer literally made me lol
8th Jan 2017, 11:51 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 6
@Rina Mirushita #include <iostream> using namespace std; int main() { int TSum=0; for(int j=2 ;j<=10;j+=2){ int AccSum=0; for(int i=10;i>=j;i-=2){ AccSum+=i; TSum+=i; cout<<i; if (j!=i){ cout<<"+"; } else{ cout<<"="; } } cout<<AccSum; cout<<endl; } cout<<"===========+"<<endl; cout<<TSum; return 0; }
8th Jan 2017, 11:56 AM
ASNM
ASNM - avatar
+ 4
@Dinu lol. thanks.
8th Jan 2017, 1:22 PM
ifl
ifl - avatar
+ 2
what's the difference? it outputs the same thing
8th Jan 2017, 11:56 AM
Dinu
Dinu - avatar
8th Jan 2017, 1:42 PM
Michael Isac Girardi
Michael Isac Girardi - avatar
+ 2
thank you very much 😊
8th Jan 2017, 1:42 PM
Rina Mirushita
Rina Mirushita - avatar
0
why we use using name space std; ?
24th Jan 2017, 3:44 AM
Taha Malik
Taha Malik - avatar
0
0+100
3rd Feb 2017, 12:56 PM
Gaurav shinde
Gaurav shinde - avatar
0
its'a header file bro
5th Feb 2017, 5:15 AM
Rinku Dubey
Rinku Dubey - avatar
0
@Taha Malik,if you don't use it,you need to put std:: before every cout,cin,endl,shortly,all the things iostream includes,it's easier to put namespace std
5th Feb 2017, 11:53 AM
Dinu
Dinu - avatar