Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele If-Else-operaattorin Harjoittelu | Ohjauslauseet
C:n Perusteet

bookIf-Else-operaattorin Harjoittelu

Ohjelma, joka ilmoittaa korkeasta lämpötilasta

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; }
Tehtävä

Swipe to start coding

Laadi laskin, joka jakaa luvut, mutta vain jos kumpikaan luvuista ei ole nolla.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 2
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

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?

close

bookIf-Else-operaattorin Harjoittelu

Pyyhkäise näyttääksesi valikon

Ohjelma, joka ilmoittaa korkeasta lämpötilasta

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; }
Tehtävä

Swipe to start coding

Laadi laskin, joka jakaa luvut, mutta vain jos kumpikaan luvuista ei ole nolla.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 2
single

single

some-alt