Program in C to check a given number is odd or even number using goto statement.
#include<conio.h> #include<stdio.h> void main() { int n; char ch; start: printf("Enter a number :-"); scanf("%d",&n); if(n%2==0) printf("%d is even no.",n); else printf("%d is odd no.",n); printf("\nDo you want to exit."); fflush(stdin); scanf("%c",&ch); if(ch=='n'||ch=='N') goto start; getch(); }Output:-
1 Comments