on C++, I want to make an operation like " 2x + y - z ", I wrote something like that but I can' t get the result, where is my mistake? Ty.
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
char op;
int x;
int y;
int z;
int f;
printf ("Enter the operation\n");
scanf ("%c%d%d%d", &x, &y, &z );
f = 2 * x + y - z;
printf ("The result is %d\n", f);
system("pause");
return 0;
}
1 answer
what receives the %c value?