Computer Science - Object Oriented Programming Using C++ - Discussion
Discussion Forum : Object Oriented Programming Using C++ - Section 3 (Q.No. 34)
34.
In a simple 'if' statement with no 'else'. What happens if the condition following the 'if is false?
Discussion:
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");
}
Output:
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.
#include <stdio.h>
int main()
{
int i = 10;
if (i > 15)
{
printf("10 is less than 15");
}
printf("I am Not in if");
}
Output:
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:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers