Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   C programing (http://www.go4expert.com/forums/c-programing-t5982/)

ankushgupta 22Aug2007 17:42

C programing
 
Q. 1 Write algorithm for the following :
a) to check whether an entered number is odd / even.
b) to calculate sum of three numbers.

pls. solve this.

shabbir 22Aug2007 21:36

Re: C programing
 
Solution 1:
Code:

if(num % 2 == 0)
  Num is Even
else
  Num is Odd

Solution 2:
Code:

res = a+b+c;


All times are GMT +5.5. The time now is 09:00.