Computer Science, asked by suk4eybumpi, 1 year ago

C Program to Find the Given Number is Odd or Even
Write a C program to find whether the given number is odd or even.

Answers

Answered by yasas
5
#include<stdio.h>
void main()
{
   int a;
   clrscr();
   printf("given number:");
   scanf("%d",&a);
      if(a%2==0)
         printf("%d is even number");
     else
        printf('%d is odd number");
 getch();
}
output for the above program is 
given number:4
4 is even number
Answered by Nirmanmochi06
0

Answer:#include<stdio.h>

              #include<conio.h>

              void main()

              {

               int x;

              clrscr();

              printf("Enter the value of x:");

              scanf("%d",&x);

              if(a%2==0)

              {

        printf("x is even");

         }

         else

          {

          printf("x is odd");

          getch();

           }

Explanation:

Similar questions