prev


Ternary Operator

27. Smallest of two numbers(7.7.2009)

/*
Program# 27
date : 25-12-2008
Smallest of two numbers
*/

#include <stdio.h>
main(){
int a,b,c;
printf("\nEnter two integers :");
scanf("%d %d",&a,&b);
c=(a<b)?a:b;
printf("\n%d : Smallest number\n",c);
}

output:
Enter two integers :12 2
2 : Smallest number

next
blog comments powered by Disqus