Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ch = '+'; printf(ch = %c , ch); switch (ch) { case '+': f = a + b; printf(f = %d , f); break; case
ch = '+';
printf("ch = %c ", ch);
switch (ch) {
case '+': f = a + b; printf("f = %d ", f); break;
case '-': f = a - b; printf("f = %d ", f); break;
case '*': f = a * b; printf("f = %d ", f); break;
case '/': f = a / b; printf("f = %d ", f); break;
default: printf("invalid operator ");
Use getChar() to replace ch = '+';
Somebody please help me switch this code for C into a for loop, ive posted this 2 times and no one gives the right answer. I need to see the for loop version of this code above^^. Thanks.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started