Hello,
I couldn't understand how does this "else" belong to inner "if" other than outer if when we dont use curly brackets or semicolon after outer if?
Code:
#include <stdio.h>
int main (void) {
int x=4,y=2,z=3;
if(x<y)
if(x<z)
printf ("Minimum is x1 ");
else
printf ("Minimum is z2 ");
return 0;
}
//NO WRITTEN OUTPUT
Code:
#include <stdio.h>
int main (void) {
int x=4,y=2,z=3;
if(x<y);
if(x<z)
printf ("Minimum is x1 ");
else
printf ("Minimum is z2 ");
return 0;
}
//OUTPUT: Minimum is z2
Code:
#include <stdio.h>
int main (void) {
int x=4,y=2,z=3;
if(x<y){
if(x<z)
printf ("Minimum is x1 ");}
else
printf ("Minimum is z2 ");
return 0;
}
//OUTPUT: Minimum is z2
[/CODE]