C Program To Check Even And Odd Number Using Function

Here we will write a program to check whether the given no is Even or Odd using Function which is of type "Takes Something Returns Nothing" which means the function takes argument from the main function but doesn't return any value.



#include<stdio.h>

void Even(int);       // Function Declaration

int main()
{
int x;

   printf("Enter the no:\n");

   scanf("%d",&x);

   Even(a);         // Function Calling

return 0;

}

void Even(int a)      // Function Definition

{
   if(a%2==0)

     {  printf("The no  is Even.\n",); }

    else

    {  printf("The no  is Odd.\n"); }
}

No comments:

Post a Comment