C programing

Newbie Member
22Aug2007,17:42   #1
ankushgupta's Avatar
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.
Go4Expert Founder
22Aug2007,21:36   #2
shabbir's Avatar
Solution 1:
Code:
if(num % 2 == 0)
  Num is Even
else
  Num is Odd
Solution 2:
Code:
res = a+b+c;