Asked by Kaan
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
Answered by
Steve
what receives the %c value?
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.