🎯 Conditions in C
Em poucas palavras
Definição técnica ou simplificada do conceito.
📝 Notas e Desenvolvimento
C supports several ways to execute conditions, using keywords such as if, else, and else if. See the example below:
if (x > 0) // First condition
{
printf("Number is positive");
}
else if (x < 0) // Second condition
{
printf("Number is negative"); // Else if the number is less than zero
}
else: // Else is executed if nothing else has occurred above.
{
printf("Number is 0");
}Some examples of conditional operators are:
| C | Description |
|---|---|
| < | less than |
| <= | less than or equal to |
| > | greater than |
| >= | greater than or equal to |
| == | equal to |
| != | not equal to |
:: Reference: :: C If … Else Conditions (w3schools.com)
🔗 Conexões e Contexto
- Atlas: MdC - Programação
- Notas Relacionadas: