Sunday, August 2, 2009

I need major help on writing a C program on Dev-C++.. heres the question?

Write a C program that will read (scan) 4 integer numbers from the keyboard and will add those numbers. As the output from the C program, it will display the result of the addition on the monitor screen.

I need major help on writing a C program on Dev-C++.. heres the question?
#inculuse %26lt;iostream%26gt;


using namespace std;





int main ()


{


int num1, num2;





cout %26lt;%26lt; "Number 1";


cin %26gt;%26gt; num1;


cout %26lt;%26lt; "Number 2";


cin %26gt;%26gt; num2;


cout %26lt;%26lt; num1 + num2 ;


return 0;


}
Reply:very simple here is some hints or pseducode...


set rem = 0


loop up to number not divisible by 10


set rem += num % 10


set num = num / 10


end loop





in simple try using reminder and divisible operator.





hope you understand it all.





bye
Reply:You may contact a c++ helper live at website like http://ccietutorial.com/
Reply:you can try to find it out


http://tutorialofc.blogspot.com/


No comments:

Post a Comment