Nested If-else
The If condition is true so execute statement-1, other-then next condition checked else-if condition is true so execute statement-2, or so on.
you know that if condition is true then statement execute. else if condition also like if operation perform .
Syntax: - If (condition)
{
Statement-1;
}
else if
(condition)
{
Statement;
}
:
:
else {
Statement;
}
Example: -
The If condition is true so execute statement-1, other-then next condition checked else-if condition is true so execute statement-2, or so on.
you know that if condition is true then statement execute. else if condition also like if operation perform .
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <stdio.h> //header file section int main() { int x = 47, y = 25, z = 3; if (x > y) { if (x > z) { printf("The value x is greater than y and z "); } } printf("\n This is normal flow "); return 0; } |
c programming examples for program writers
ReplyDeleteDo while loop and continue in c language
visit -> https://s6schools.blogspot.com/2019/04/do-while-loop.html
ReplyDelete