C++ if-else-if ladder statement

This statement allows the user to have multiple options to check for different conditions. Here, if one of the if or else-if condition is true then that part of the code will be executed and the rest will be skipped. if none of the conditions are true then the final else statement present at the … Read more

C++ nested if statement

This statement allows the user to use if block inside the other if block. And the inner if statement is executed only if the outer if statement’s condition is true. The syntax of the nested if statement in C++: You can also nest the if..else statement in same manner as shown below. nested if statement Flowchart: Example … Read more

C++ if…else statement

If the Boolean expression is true then the code inside the if statement block is executed or if it is false then the code inside else statement will be executed. Hence if..else statement. The syntax of the if..else statement in C++: If…else Flowchart: Example of if…else statement in C++ The output of if…else statement in C++.

C++ if Statement

An if statement consists of a Boolean expression followed by one or more statements. If the Boolean expression is true, the block of code inside the if statement will be executed else not. This is most simple of all the decision making statements. The syntax of the if statement in C++: If the condition is evaluated true, block of … Read more

C# Keywords and Identifiers

It is important that before programming you should know the C# Keywords and Identifiers. You need to know that keywords cannot be used as identifiers and more. C# Keywords There are some predefined and reserved words that have special meanings to the compiler. These words are called Keywords. The meaning of the keywords in C# … Read more

Type Casting in C#

C# allows us to convert the variables of one data type to another. This conversion referred to as type conversion or type casting. There are various ways to typecast variables, casting can be between a larger size type to a smaller size type or vice-versa. There are two types of casting in C#: Implicit Casting (automatic … Read more

C# Bitwise Operators

Bitwise operators are used to perform a bit-level operation on operands. They are used in testing, setting, or shifting the actual bits in a program. You can see the truth table below. p q p & q p | q p ^ q ~p 0 0 0 0 0 1 0 1 0 1 1 … Read more

C# Unary Operators (Increment and Decrement)

Unary Operators are the Increment and Decrement Operators. They operate on a single operand. They are ++ and — operators. ++ is used to increase the value by 1 and — is used to decrease the value by 1. Post-Increment or Post-Decrement:First, the value is used for operation and then incremented or decremented. Represented as … Read more

C# Logical Operators

Logical Operators are used to compute the logical operation in a program such as &&, || and !. They are used to evaluate the condition. The following are the C# Logical Operators. Assume X holds the value 1 and Y holds 0 Operator Description Example && (logical and) If both the operands are non-zero, then the … Read more

C# Relational Operators

Relational Operators are used in a program to check the relationship between two operands and accordingly, it returns boolean values, true or false. These operators are used with loops and Decision-Making Statements during condition checking. List of relational operators in C#: Operator Name Example == Equal to. A == B != Not equal. A != … Read more