Я не могу понять, почему этот код дает мне неправильные результаты для умножения, деления и вычитания ?? где это дает мне, что результат любой операции умножения равен нулю, а результат любой ошибки деления, наконец, результат вычитания всегда равен 1
#include <stdio.h>
long operations(char x,int num1 ,int num2 );
int main(void) {
char x;
int num1 , num2;
long result;
setbuf(stdout,NULL);
result=operations(x,num1 ,num2 );
}
long operations(char x,int num1 ,int num2 )
{
printf("please enter your operation sum (1) ,subtrcation(2),mul(3),div(4) :");
scanf("%d",&x);
if (x==(1||2||3||4))
{
printf("please enter the first and second numbers : \n ");
scanf ("%d%d" ,&num1 ,&num2);
}
else
{
printf("error ") ;
}
switch (x)
{
case 1:
{
return printf("the result sum is :%d ",(num1+num2)) ;
}
case 2:
{
return printf("the result of subtraction is :%d ",(num1-num2)) ;
}
case 3:
{
return printf("the result multiblication is :%d ",(num1*num2)) ;
}
case 4:
{
return printf("the result division is :%d ",(num1/num2)) ;
}
}
}