Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago