Even or odd number

Program:

#include<stdio.h>
int main()
{
int num;
printf("Enter number: ");
scanf("%d",&num);
if(num%2==0)
{
printf("%d is even",num);
}
else
{
printf("%d is odd",num);
}
return 0;

}

Output:




No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...