Monday, 30 March 2015

c program to check whether the given number is even or odd using goto statement

write a c program to check whether the given number is even or odd  using goto statement

/* c program to check whether the given  number is even or odd  using goto statement */

/* author: sai      date:30-3-2015 */

#include<stdio.h>
int main()
{
 int n;
 printf("\n enter number to check even or odd");
 scanf("%d",&n);
 if(n%2==0)
 goto even;
 else
 goto odd;
 even:printf("%d is even number\n",n);
 return;
 odd: printf("%d is odd number\n",n);
}



No comments:

Post a Comment