Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!