Thursday, 13 October 2016

HHW Q9. WAP to find smallest among 3 entered nos.

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d;
cout<<"Enter 3 nos.";
cin>>a>>b>>c;
d=a<b?(a<c?a:c):(b<c?b:c);
cout<<"Smallest no. is = "<<d;
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...