Question
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;
}
#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;
}
Answers
what receives the %c value?
Related Questions
What was the secret CIA operation to overthrow the Cuban Government called?
Operation Seagu...
Which operation led to the Allied forces breaking through the Gothic Line?
A) Operation Overlord...
Which operation led to the Allied forces breaking through the Gothic Line?
Operation Olive
Ope...
The large amphibious attack on the beaches of Normandy was called
A.
Operation Torch.
B....