LAB RECORD PROGRAM NO -3

 3.Write a C Program to check whether a given number is even or odd. 

#include<stdio.h>

  #include <conio.h>

void main() 

 int n; 

 printf("Enter an integer\n"); 

 scanf("%d", &n); 

 if (n%2 == 0) 

 printf("\nGiven Number %d is an Even Number.",n); 

 else

 printf("\nGiven Number %d is an Odd Number.",n "); 

 getch(); 

}

Comments

Popular posts from this blog