Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
if-else Operator Practice | Control Statements
C Basics
course content

Course Content

C Basics

C Basics

1. Introduction
2. Data
3. Operators
4. Control Statements
5. Functions
6. Pointers

bookif-else Operator Practice

A Program Alerting High Temperature

c

main

copy
123456789101112131415161718
#include <stdio.h> int main() { int temperature = 200; // in 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

Construct a calculator that divides numbers, but only if neither of the numbers is zero.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 2
toggle bottom row

bookif-else Operator Practice

A Program Alerting High Temperature

c

main

copy
123456789101112131415161718
#include <stdio.h> int main() { int temperature = 200; // in 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

Construct a calculator that divides numbers, but only if neither of the numbers is zero.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 2
toggle bottom row

bookif-else Operator Practice

A Program Alerting High Temperature

c

main

copy
123456789101112131415161718
#include <stdio.h> int main() { int temperature = 200; // in 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

Construct a calculator that divides numbers, but only if neither of the numbers is zero.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

A Program Alerting High Temperature

c

main

copy
123456789101112131415161718
#include <stdio.h> int main() { int temperature = 200; // in 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

Construct a calculator that divides numbers, but only if neither of the numbers is zero.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 4. Chapter 2
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
some-alt