## Menu driven program for basic arithmetic operations

Program Description

This program demonstrates simple arithmetic operations on given numbers using menu system.The main objective of this program is to demonstrate the program flow control by user selected options from the given menu. The program uses switch structure to implement this feature

Program
```/********************************************
*	code.cheraus.com
*
*  Menu driven program for basic arithmetic operations
*
*
********************************************/

#include<stdio.h>

int main()
{
float num1,num2,ans;
int opt;

//taking user input
do
{
printf("\nEnter the First Number : ");
scanf("%f",&num1);
printf("\nEnter the Second Number : ");
scanf("%f",&num2);

printf("\n2.Subtraction\n3.Multiply\n4.Divide\n5.Exit");
scanf("%d",&opt);
switch(opt)
{
case 1:
ans = num1+num2;
printf("\nThe addition of 2 numbers is : %f",ans);
break;
case 2:
ans = num1-num2;
printf("\nThe differnce of 2 numbers is : %f",ans);
break;
case 3:
ans = num1*num2;
printf("\nThe product of 2 numbers is : %f",ans);
break;
case 4:
ans = num1/num2;
printf("\nThe division of 2 numbers is : %f",ans);
break;
case 5:
break;
default:  //error message for wrong choice
printf("\nYou Entered Wrong Choice\n");
break;
}
}while(opt!=5);
return 0;
}
```

Output
Enter the First Number : 23
Enter the Second Number : 123
2.Subtraction
3.Multiply
4.Divide
5.Exit
The addition of 2 numbers is : 146.000000
Enter the First Number : 123
Enter the Second Number : 234

2.Subtraction
3.Multiply
4.Divide
5.Exit
The differnce of 2 numbers is : -111.000000
Enter the First Number : 12
Enter the Second Number : 13

2.Subtraction
3.Multiply
4.Divide
5.Exit
The product of 2 numbers is : 156.000000
Enter the First Number : 123
Enter the Second Number : 23