hi there i want to make a console application which the user can pick whether a calculator or a temp converter but the problem is it wont compile at all need help......
Code:
#include <stdio.h>
#include <conio.h>
int main(void)
{
int menu, menu1, numb1, numb2, total;
int valid = 0;
while(valid == 0){
printf("ENTER CHOICE\n");
puts("1 = calculator");
puts("2 = TEMP converter");
scanf("%d", &menu);
if((menu == 1) || (menu == 2))
valid = 0;
else{
printf("****GOODBYE YOU PICK A WRONG CHOICE*****\n");
getch();
return 0;
}
if(menu == 1)
{
printf("ENTER IN FIRST NUMBER\n");
scanf("%d", &numb1);
puts("enter second number");
scanf("%d", &numb2);
puts("Enter in choice");
puts("1 = addition");
puts("2 = subtraction");
scanf("%d", &menu);
switch(menu){
case 1: total = numb1 + numb2; break;
case 2: total = numb1 - numb2; break;
default: printf("sorry wrong choice\n");
}
printf("%d\n", total);
{
getch();
return 0;
}
}
else if(menu ==2)
{
puts("enter temp");
scanf("%d", &numb1);
puts("enter in choice");
puts("1 = fahr to celsius");
puts("2 = celsius to fahr");
scanf("%d", &menu1);
switch(menu1){
case 1: total = (5.0/9.0)*(numb1-32); break;
case 2: total = (9.0/5.0)*numb1+32; break;
default: printf("Wrong selection\n");
}
printf("%d\n", total);
getch();
return 0;
}
}
getch();
return 0;
}
that's the code[not yet finish]////// help needed...