#define _crt_secure_no_warnings
#include<stdio.h>
void menu()
{
printf("\n\n\tCalculator Menu");
printf("\n\t================");
printf("\n1. Add 2 number.");
printf("\n2. Divide 2 number.");
printf("\n3. Multiply 2 number.");
printf("\n4. Modulus of 2 numbers.");
printf("\n5. Convert Decimal to Binary.");
printf("\n6. Convert Decimal to Otcal.");
printf("\n7. Convert Decimal to Hexadecimal.");
printf("\n\n\t0. To exit");
}
int main()
{
char a[100],b;
long int n;
int i,j,re,num,select,count = 0;
do
{ menu(); //print menu
printf("\nPlease select an option : ");
scanf("%d", &select); //input your option
switch (select)
{
case 1://add
printf("please input the number(Two digits separated by a space): ");
scanf("%d%d", &i, &j);
printf("%d+%d=%d\n", i, j, num = i + j);
break;
case 2: // subtraction
printf("please input the number(Two digits separated by a space): ");
scanf("%d%d", &i, &j);
printf("%d-%d=%d\n", i, j, num = i - j);
break;
case 3:// Multiply
printf("please input the number(Two digits separated by a space): ");
scanf("%d%d", &i, &j);
printf("%d*%d=%d\n", i, j, num = i*j);
break;
case 4: //Divide
printf("please input the number(Two digits separated by a space): ");
scanf("%d%d", &i, &j);
printf("%d/%d=%d\n", i, j, num = i / j);
break;
case 5: //Convert Decimal to Binary
printf("please input the number: ");
scanf("%d",&i);
do{ a[count++]=i%2;i=i/2; }while(i!=0);
for(int z=count-1;z>=0;z--){
printf("%d",a[z]);}
count=0;
break;
case 6: //Convert Decimal to Octal
printf("please input the number: ");
scanf("%d",&i);
do{ a[count++]=i%8;i=i/8; }while(i!=0);
for(int z=count-1;z>=0;z--){
printf("%d",a[z]);}
count=0;
break;
case 7: // Convert Decimal to Hexadecimal
printf("please input the number: ");
scanf