+ 1

Print sum of odd numbers between 1 and 1oo in c++.

Please help.

9th Dec 2017, 12:42 PM
alikhan124
alikhan124 - avatar
7 Respostas
9th Dec 2017, 12:53 PM
Mansi Dagla
Mansi Dagla - avatar
+ 4
for(i=1;i<100;i+=2) { s+= i ; } cout<<S; or for(i=1;i<100;i++) { if(i%2!=0) s+=i; } cout<<s;
9th Dec 2017, 12:47 PM
Mansi Dagla
Mansi Dagla - avatar
+ 4
OK I will
9th Dec 2017, 12:51 PM
Mansi Dagla
Mansi Dagla - avatar
+ 3
@alikhan I am not bro 😅
9th Dec 2017, 12:58 PM
Mansi Dagla
Mansi Dagla - avatar
+ 2
Can u plzz write the full program?
9th Dec 2017, 12:49 PM
alikhan124
alikhan124 - avatar
+ 2
I am a bigineer
9th Dec 2017, 12:50 PM
alikhan124
alikhan124 - avatar
+ 1
Thanx alot bro u r great
9th Dec 2017, 12:54 PM
alikhan124
alikhan124 - avatar