C Program – Given number is Even or Odd

By | 2017-08-22T16:52:44+00:00 August 22nd, 2017|c-program|0 Comments

C Program to find given number is Even or Odd.

Even or Odd :


#include<stdio.h> 
int main(void) 
{ 
    int n; 
    printf("Enter any number : "); 
    scanf("%d",&n); 
    if(n%2==0)             
        goto even_number; 
    else 
        goto odd_number; 
    even_number: 
        printf("Given number is even\n");  
        goto end; 
    odd_number: 
        printf("Given number is odd\n"); 
        goto end; 
    end: 
    printf("\n"); 
    return 0; 
}

[box type=”success” align=”alignleft” class=”” width=”100%”]

Enter any number : 10
Given number is even

Enter any number : 7
Given number is odd

[/box]

Happy Learning 🙂

About the Author:

Hi Folks, you have reach this so far, that shows you like what you are learning. Then why don't you support us to improve for bettor tutorials by leaving your valuable comments and why not you keep in touch with us for latest updates on your favorite blog @ facebook , twitter , Or Google+ ,

Leave A Comment