Program:1
#include <stdio.h>
i n t m a i n ( )
i n t a , b , c ;
c l r s c r ( ) ;
s c a n f ( “ % d % d ” , & a , & b ) ;
c = a + b ;
p r i n t f ( “ T h e s u m i s % d ” , c ) ;
g e t c h ( ) ;
r e t u r n 0 ;
P r o g r a m : 2
#include <stdio.h>
void main()
{
int N = 10;
if (N == 0)
{
printf("Zero\n");
}
else if (N < 0)
{
printf("Negative\n");
}
// If neither, the number is positive
else
{
printf("Positive\n");
}
return 0;
}
Output:Positive
Program:2
#include <stdio.h>
int main()
{
int N = 11;
void checkOddEven(int N)
{
// Find the remainder
int r = N % 2;
// Condition for even
if (r == 0)
{
printf("Even");
}
// Condition for odd number
else {
printf("Odd");
}
}
checkOddEven(N);
return 0;
}
Output
odd