Computer Science - Object Oriented Programming Using C++ - Discussion

Discussion Forum : Object Oriented Programming Using C++ - Section 3 (Q.No. 34)
In a simple 'if' statement with no 'else'. What happens if the condition following the 'if is false?
the program searches for the last else in the program
control 'falls through' to the statement following 'if
the body of the statement is executed
None of the above
Answer: Option
No answer description is available. Let's discuss.
2 comments Page 1 of 1.

Ayesha. said:   3 years ago
C program to illustrate If statement:

#include <stdio.h>

int main()
int i = 10;

if (i > 15)
printf("10 is less than 15");
printf("I am Not in if");

I am Not in if

As the condition present in the if statement is false. So, the block below the if statement is not executed.

Rohit said:   1 decade ago
Explain please.

Post your comments here:

Your comments will be displayed after verification.