Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn if-else Operator Practice | Control Statements
C Basics (copy)

bookif-else Operator Practice

A Program Alerting High Temperature

main.c

main.c

copy
123456789101112131415
#include <stdio.h> int main() { int temperature = 200; // Π¨n celsius if (temperature > 80) { printf("Temperature is so high: %d degrees Celsius\n", temperature); } else { printf("Temperature is normal: %d degrees Celsius\n", temperature); } return 0; }
Task

Swipe to start coding

Construct a calculator that divides numbers, but only if neither of the numbers is zero.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain how the program alerts for high temperature?

What temperature threshold does the program use for alerts?

Can you show an example of how the alert looks?

close

bookif-else Operator Practice

Swipe to show menu

A Program Alerting High Temperature

main.c

main.c

copy
123456789101112131415
#include <stdio.h> int main() { int temperature = 200; // Π¨n celsius if (temperature > 80) { printf("Temperature is so high: %d degrees Celsius\n", temperature); } else { printf("Temperature is normal: %d degrees Celsius\n", temperature); } return 0; }
Task

Swipe to start coding

Construct a calculator that divides numbers, but only if neither of the numbers is zero.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 2
single

single

some-alt