Skip to main content

Posts

Showing posts with the label 17. Write a C program to check whether a number is even or odd.

ads1

17. Write a C program to check whether a number is even or odd.

 17 . Write a C program to check whether a number is even or odd. Solution :-  #include<stdio.h> #include<conio.h> void main() {     clrscr();     int a;     printf("Enter the number :- ");     scanf("%d",&a);     if(a%2==0)     {         printf("%d is Even number");     }     else     {         printf("%d is Odd number");     } getch(); } Output :-     

ads2