Solved programming problem

Finding Even or Odd with Function in C.

Source code

#include<stdio.h>

void even_odd(int m) ///Receive the integer

{

    if(m%2==0)

    {

      printf("
This is an Even Number
");

    }

    else if(m%2!=0)

    {

         printf("
This is an Odd Number
");

    }

}

int main()

{

    int n;

    printf("Please Enter A Number: ");

    scanf("%d",&n);

    even_odd(n); ///call the function and pass the integer

    return 0;

}

Output

Please Enter A Number: 11

This is an Odd Number

Join the discussion

Add your comment