Jan 27 2013, 02:39 PM
Code:
#include "stdio.h"
#include "conio.h"
#include "math.h"
void welcome();
#pragma startup welcome
#pragma warn-rch
int main()
{
int a,b,c,menu;
printf("Enter 1,2,3 or 4\n\n");
printf("1.Addition\n");
printf("2.Subraction\n");
printf("3.Division\n");
printf("4.Multiplication\n");
scanf(" %d",&menu);
if(menu==1)
{
printf("Enter any two no.s\n");
scanf(" %d%d",&a,&b);
goto add;
}
else if(menu==2)
{
printf("Enter any two no.s\n");
scanf(" %d%d",&a,&b);
goto sub;
}
else if(menu==3)
{
printf("Enter any two no.s\n");
scanf(" %d%d",&a,&b);
goto div;
}
else if (menu==4)
{
printf("Enter any two no.s\n");
scanf(" %d%d",&a,&b);
goto multi;
}
add:
c=a+b;
printf("Addition of two no. is = %d\n",c);
div:
c=a/b;
printf("Division of two no. is = %d\n",c);
multi:
c=a*b;
printf("Multiplication of two no. is = %d\n",c);
sub:
c=a-b;
printf("Subraction of two no. is = %d\n",c);
getch();
return 0;
}
void welcome()
{
printf("Danger -- Welcomes you!\n\n");
}
Double post
Guys the else done now help me getting out I mean
Code:
add:
c=a+b;
printf("Addition of two no. is = %d\n",c);
div:
c=a/b;
printf("Division of two no. is = %d\n",c);
multi:
c=a*b;
printf("Multiplication of two no. is = %d\n",c);
sub:
c=a-b;
printf("Subraction of two no. is = %d\n",c);
So all get printed I want the one I choose .......
GOT THE SOLUTION MYSELF!!