Pages

Sunday, December 29, 2013

Logical AND Operator

Write a program that accept three number from the user and display Largest number


Input:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#include <stdio.h>
#include <conio.h>
void main(void)
{      clrscr();
 int a, b, c;
 printf("Enter three integer values: ");
  scanf("%d, %d, %d", &a, &b, &c);
  if (a>b && a>c)
     printf("%d is largest.", a);
  else if (b>a && b>c)
     printf("%d is largest.", b);
  else
     printf("%d is largest.", c);
}// main

No comments:

Post a Comment