Ö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 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?
Fantastiskt!
Completion betyg förbättrat till 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