filmov
tv
else if ladder in C Programming Language

Показать описание
What is use of else if ladder in C Program? In this video lecture cover the student mark sheet variable like roll number in int, name in char 1-D Array, two subject marks these four variable take from programmer and calculate total marks, percentage and based on percentage find else if ladder logic calculate the student class, also use the fflush and gets function. When user supply the name of student that use fflush for clear buffer and get proper all value of student. The fflush function is use to clear the buffer in standard input and output, but here use stdin that argument. Second main learn point scanf function not take black space in their value read in string array only read one word that is limitation of scanf function, here use the gets function to get with blank space name of student. The syntax of else if ladder is:
if(condition1)
{ statement1;
}
else if(condition2)
{
statement2;
}
else if(condition N)
{
statement N;
}
else
statement;
like real ladder design is create, so it is called else if ladder statement in C Programming language. Only one if condition is true that block of statements are execute or all if conditions are false than else statement is execute.
if(condition1)
{ statement1;
}
else if(condition2)
{
statement2;
}
else if(condition N)
{
statement N;
}
else
statement;
like real ladder design is create, so it is called else if ladder statement in C Programming language. Only one if condition is true that block of statements are execute or all if conditions are false than else statement is execute.