Pages

Sunday, December 29, 2013

Nested if in two-way selection

Input:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include <stdio.h>
#include <conio.h>
void main (void)
   {
   clrscr();
   int a, b;
   printf("Enter two integer values: ");
    scanf("%d, %d", &a, &b);
   if (a<=b)
     if(a<b)
     printf("\n %d < %d", a, b);
     else // equal
     printf("\n %d = %d", a, b);
   else // a>b
     printf("\n %d > %d", a, b);
     getch();  }// main

1 comment: