if-else Operator Practice
A Program Alerting High Temperature
main.c
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?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 2
single
Ask AI
Ask AI
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?
Awesome!
Completion rate improved to 2.63
if-else Operator Practice
Swipe to show menu
A Program Alerting High Temperature
main.c
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?
Thanks for your feedback!
SectionΒ 4. ChapterΒ 2
single