Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
if statement | Control Structures
course content

Contenido del Curso

C# Basics

if statementif statement

An if-statement, also known as Conditional Statement, is a method of executing a block of code based on a condition. The syntax of an if-statement is the following:

It takes an expression and executes the code block if the expression is true.

For-example:

cs

main.cs

In case the condition is false the code block is ignored:

cs

main.cs

What is the output of the following code:

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 3. Capítulo 5
course content

Contenido del Curso

C# Basics

if statementif statement

An if-statement, also known as Conditional Statement, is a method of executing a block of code based on a condition. The syntax of an if-statement is the following:

It takes an expression and executes the code block if the expression is true.

For-example:

cs

main.cs

In case the condition is false the code block is ignored:

cs

main.cs

What is the output of the following code:

Selecciona la respuesta correcta

¿Todo estuvo claro?

Sección 3. Capítulo 5
some-alt