Wednesday 25 March 2015

program for use goto keyword

/*goto*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("\n any no");
scanf("%d",&n);
if(n%2==0)
{
goto even;
}
else
{
goto odd;
}
even:printf("no is even");
goto hello;
odd:printf("no is odd");
goto end;
end:printf("\n program is finished");
hello:printf("hello");
getch();
}

No comments:

Post a Comment