ad

Saturday, February 22, 2025

c program to check number is even or odd use if else

                       c program

c program to check number is even or odd

c program to check number is even or odd

Examples :-

// even or odd program if else //if else statement statement only allows // program to execute one block of code if a check condition // is true than execute the block or condition is false than exite the block // of code. #include<stdio.h> int main() { int number= 0; printf("enter a number"); scanf("%d",&number); if(number %2 ==0 ) { printf("%d is even"); } else { printf("%d is odd"); } return 0; }


  1. ] c program to check number is even or odd

Output 

enter a number  
7 is Odd

  1. ] c program to check number is even or odd

Output 

enter a number 

2 is even


Related post :-

c program add two integer number

left pascal star pattern in php

No comments:

Post a Comment