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 show me the code for the temperature alert program?
How does the program determine what is considered a high temperature?
Can you explain how the alert is triggered in the program?
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