see buddies i make a program in c but it take enter 1st number then ask for opearator and then directly tell that wrong opearator iam tired but i cant find where is problem
here it is :::::
#include <conio.h>
#include <math.h>
#include <stdio.h>
#define PI 3.14159265
int main()
{
float firstNumber, secondNumber;
float resultSqrt, resultSin, resultCos, resultTan;
char operation ,boolSqrt;
printf("TITLE My Calculator Program.");
printf(" *****************************************\n" );
printf(" Simple Calculator!\n" );
printf (" *****************************************\n\n");
printf( " OPERATORS : +, -, *, /, !, S, C, T\n");
printf( " \n");
printf (" + = ADD\n - = SUBTRACT\n * = Multiplication\n ");
printf ("/ = Division\n ! = SQAURE ROOT\n S = SIN\n ");
printf ("C = COS\n T = TAN\n");
printf(" \n ************************************************\n");
printf(" NOTE : YOU CAN USE X AND x FOR MULTIPLICATION!\n");
printf(" ************************************************\n\n");
printf( "\n ENTER FIRST NUMBER : ");
scanf("%f",& firstNumber);
printf("\n ENTER OPERATOR SIGN : ");
scanf("%ch",& operation);
resultSqrt = sqrt (firstNumber);
resultSin = sin (firstNumber*PI/180);
resultCos = cos (firstNumber*PI/180);
resultTan = tan (firstNumber*PI/180);
switch(operation)
{
case '+':
printf("\n ENTER SECOND NUMBER : ");
scanf("%f",& secondNumber);
printf("\n Answer = ", firstNumber + secondNumber);
break;
case '-':
printf("\n ENTER SECOND NUMBER : ");
scanf("%f",& secondNumber);
printf("\n Answer = ",firstNumber - secondNumber);
break;
case '*':
case 'x':
case 'X':
printf("\n ENTER SECOND NUMBER : ");
scanf("%f", & secondNumber);
printf("\n Answer = ",firstNumber * secondNumber);
break;
case '/':
printf("\n ENTER SECOND NUMBER : ");
scanf("%f", & secondNumber);
printf("\n Answer = ",firstNumber / secondNumber);
break;
case '!':
printf("\n ANSWER = " , resultSqrt);
break;
case 'S':
case 's':
printf("\n ANSWER = " , resultSin);
break;
case 'C':
case 'c':
printf("\n ANSWER = " ,resultCos);
break;
case 'T':
case 't':
printf("\n ANSWER = " ,resultTan);
break;
default:
printf("\n WRONG MATHMATICAL OPERATOR!");
break;
}
getch();
}