Pages

Saturday, December 28, 2013

Condition Operator

Write a program that will demonstrate Condition Operator 


Input:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include <stdio.h>
#include <conio.h>
void main (void)
{
  int a, b;
  printf("Enter two integer number: ");
   scanf("%d %d", &a, &b);
   a > b ?
   printf("%d is larger", a):
   printf("%d is larger", b);
   getch();
 }// main

Result:


Enter two integer number: 87  96
96 is larger

No comments:

Post a Comment