Conditional Statements:

https://drive.google.com/file/d/1U9sYX33X1tzGqnRMbrnUuXQB8uJjbJlk/view?usp=sharing

https://drive.google.com/file/d/1f1UYWItGjVoDHo9WeLqDm7nRWLRlVePB/view?usp=sharing

https://drive.google.com/file/d/1AwqJEzzMaoQL_F9ufOQExdYWtukgc430/view?usp=sharing

https://drive.google.com/file/d/1RAwKTsnjgfyRETxpiCMuNGkIFWZtfpSm/view?usp=sharing

 PST-pdf                    Instagram                              Twitter                        YouTube

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

--------------------------------------------------------------------------------------------------------------------

1. INTRODUCTION  PST-PDF

-------------------------------------------------------------------------------------------------------------------

2. OPERATORS   PST-pdf

-------------------------------------------------------------------------------------------------------------------

3. LOOPING  PST-pdf

------------------------------------------------------------------------------------------------------------------

4. CONDITIONAL

------------------------------------------------------------------------------------------------------------------
4.1 If Statements 

The if statement evaluates the test expression inside the parenthesis ().

✔ If the test expression is evaluated to true, statements inside the body of if are executed.
✔ If the test expression is evaluated to false, statements inside the body of if are not executed.

Syntax:
if(expression)
{
statement inside;
}
statement outside;

If the expression returns true, then the statement-inside will be executed, otherwise statement-inside is skipped and only the statement-outside is executed.


For Programming Training:
DM me Instagram

4.2 If Else Statements
If the expression is true, the statement-block1 is executed, else statement-block1 is skipped and statement-block2 is executed.

Syntax:
if(expression)
{
statement block1;
}
else
{
statement block2;
}


For Programming Training:
DM me Instagram

 4.3 Else If Statements 
An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement.

Points to Remember:
✔ An if can have zero or one else and it must come after any else if's.
✔ An if can have zero to many else if and they must come before the else.
✔ Once an else if succeeds, none of the remaining else if or else will be tested.

Syntax:
if(boolean_expression 1) {
/* Executes when the boolean expression 1 is true */
} else if( boolean_expression 2) {
/* Executes when the boolean expression 2 is true */
} else if( boolean_expression 3) {
/* Executes when the boolean expression 3 is true */
} else {
/* executes when the none of the above condition is true */
}


For Programming Training:
Dm me Instagram

4.4 Switch Statements
When you want to solve multiple option type problems, for example: Menu like program, where one value is associated with each option and you need to choose only one at a time, then, switch statement is used.

✔ Switch statement is a control statement that allows us to choose only one choice among the many given choices. 
✔ The expression in switch evaluates to return an integral value, which is then compared to the values present in different cases. 
✔ It executes that block of code which matches the case value. 
✔ If there is no match, then default block is executed(if present). 
The general form of switch statement is,

switch(expression)
{
case value-1:
block-1;
break;
case value-2:
block-2;
break;
case value-3:
block-3;
break;
case value-4:
block-4;
break;
default:
default-block;
break;
}

Rules:
✔ The expression (after switch keyword) must yield an integer value i.e the expression should be an integer or a variable or an expression that evaluates to an integer.
✔ The case label values must be unique.
✔ The case label must end with a colon(:).
✔ The next line, after the case statement, can be any valid C statement.


For Programming Training:
DM me Instagram

---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
BCA                                        PST & Programming C                                   Allrounder Sita Ram Sahu
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
>

No comments:

Post a Comment