|
Nested IF
Check out the output of the following program.
#include <stdio.h>
main ( )
{
int x, y;
x = Y = 0;
clrscr () ;
printf ("Enter Choice (1 - 3 scanf("%d", &x);
if (x == 1)
{
printf("\nEnter value for y (1 - 5);
scanf ( "%d" &y) ;
if (y <= 5)
printf("\nThe value for y is . %d', Y) ;
else
printf("\nThe value of y exceeded 5 ");
}
else
printf("\nChoice entered was not 1" );
}
|