Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 412 Bytes

even.md

File metadata and controls

29 lines (23 loc) · 412 Bytes

Code:

#include<stdio.h>

void main(){
    int num;
    printf("Enter a number:");
    scanf("%d",&num);
    if(num%2==0){
      printf("%d is Even",num);
    }
    else{
      printf("%d is Odd",num);
    }
}

Algorithm:

Step 1: Start

Step 2: Read a number & Store it in variable num.

Step 3: if num%2==0

  • print "Number is Even"

else

  • print "Number is Odd"

Step 4: Stop