Code:
#include <stdio.h>
main()
{
char operator;
int a,b,c;
printf("give the operator:");
scanf("operator");
if (operator='+')
{
printf("give first number:");
scanf("%d",&a);
printf("give second number:");
scanf("%d",&b);
c=a+b;
printf("the result is:");
printf("%d",c);
printf("\n");
}
else if (operator='-')
{
printf("give first number:");
scanf("%d",&a);
printf("give second number:");
scanf("%d",&b);
c=a-b;
printf("the result is:");
printf("%d",c);
printf("\n");
}
else if (operator='*')
{
printf("give first number:");
scanf("%d",&a);
printf("give second number:");
scanf("%d",&b);
c=a*b;
printf("the result is:");
printf("%d",c);
printf("\n");
}
else if (operator='/')
{
printf("give first number:");
scanf("%d",&a);
printf("give second number:");
scanf("%d",&b);
c=a/b;
printf("the result is:");
printf("%d",c);
printf("\n");
}
}
run it and plz tell me what's going wrong because is difficult for me to explain the problem in english.