Övning Med If-Else-Operator
Ett program som varnar för hög temperatur
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; }
Uppgift
Swipe to start coding
Skapa en kalkylator som dividerar tal, men endast om ingen av siffrorna är noll.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 4. Kapitel 2
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
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
Övning Med If-Else-Operator
Svep för att visa menyn
Ett program som varnar för hög temperatur
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; }
Uppgift
Swipe to start coding
Skapa en kalkylator som dividerar tal, men endast om ingen av siffrorna är noll.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 4. Kapitel 2
single