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?
Similar Questions
  1. Which operation led to the Allied forces breaking through the Gothic Line?A) Operation Overlord B) Operation Torch C) Operation
    1. answers icon 5 answers
  2. Which operation led to the Allied forces breaking through the Gothic Line?Operation Olive Operation Torch Operation Overlord
    1. answers icon 1 answer
  3. What was the secret CIA operation to overthrow the Cuban Government called?Operation Seagull The Bay of Pigs operation Operation
    1. answers icon 1 answer
  4. The large amphibious attack on the beaches of Normandy was calledA. Operation Torch. B. Operation Enigma. C. Operation Tehran.
    1. answers icon 1 answer
more similar questions