Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

pease tell me where Im I wrong #include < iostreme.h> void main ( ) { int sum1 , sum2; sum1 = sum2 = 0; for (int i=1; i<10; i++) if ( 1% 2 = = 0) sum1+ = i ; else sum2+ = i ; cout << "sum of odd number=" << sum2 << "\n"; cout << "sum of even number= "<< sum1 << "\n" }

OpenStudy (anonymous):

question is to write a progrmam to calculate sum of odd numbers and sum of even number for nmber 1 o 10

OpenStudy (lalaly):

iostream*

OpenStudy (anonymous):

oooo yeesss

OpenStudy (lalaly):

:D

OpenStudy (anonymous):

ok but its showng error in VOID MAIN now

OpenStudy (anonymous):

:-(

OpenStudy (lalaly):

then change it to int main and then at the end return

OpenStudy (anonymous):

not workin:-(

OpenStudy (lalaly):

mm give me a min let me try it

OpenStudy (anonymous):

ok

OpenStudy (lalaly):

== not = =?

OpenStudy (lalaly):

in the if statement

OpenStudy (lalaly):

did u try it?

OpenStudy (anonymous):

1 sec

OpenStudy (lalaly):

ok

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!