About 604,000 results
Open links in new tab
  1. C++ if Statement - GeeksforGeeks

    Dec 12, 2024 · The C++ if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not executed based on a certain condition.

  2. C++ If...else (With Examples) - Programiz

    The if...else statement is used to run one block of code under certain conditions and another block of code under different conditions. In this tutorial, we will learn C++ if, if…else and nested if…else with the help of examples.

  3. C++ If ... Else - W3Schools

    Use the if statement to specify a block of C++ code to be executed if a condition is true. Note that if is in lowercase letters. Uppercase letters (If or IF) will generate an error. In the example below, we test two values to find out if 20 is greater than 18. If the condition is true, print some text: We can also test variables:

  4. Decision Making in C (if , if..else, Nested if, if-else-if )

    4 days ago · In C, programs can choose which part of the code to execute based on some condition. This ability is called decision making and the statements used for it are called conditional statements. These statements evaluate one or more conditions and make the decision whether to execute a block of code or not.

  5. if statement - cppreference.com

    Oct 18, 2024 · Used where code needs to be executed based on a condition, or whether the if statement is evaluated in a manifestly constant-evaluated context(since C++23). Note that any init-statement must end with a semicolon. This is why it is often described informally as an expression or a declaration followed by a semicolon.

  6. If Else If Statement in Programming - GeeksforGeeks

    Mar 27, 2024 · If else if statement in programming allows you to check multiple conditions sequentially and execute different blocks of code based on those conditions. It's a way to handle various cases and make decisions within a program efficiently.

  7. Conditional Statements in C++: if , if..else, if-else-if and nested if

    Learn about Conditional Statements in C++, with the if-else statements in detail along with syntax, examples, and output explanations

  8. C++ if-else Statements - W3Schools

    C++ if else Statements control the flow of the program based on conditions. If the expression evaluates to true, it executes certain statements within the if block; Otherwise, it executes statements within the else code block. This tutorial will teach you how to …

  9. 4.10 — Introduction to if statements – Learn C++ - LearnCpp.com

    Feb 11, 2025 · The simplest kind of conditional statement in C++ is called an if statement. An if statement allows us to execute one (or more) lines of code only if some condition is true. The simplest if statement takes the following form: For readability, this is more often written as following: true_statement;

  10. C++ If Statement - Online Tutorials Library

    An if statement consists of a boolean expression followed by one or more statements. The syntax of an if statement in C++ is −. If the boolean expression evaluates to true, then the block of code inside the if statement will be executed.

Refresh