Monday, 17 October 2016

HHW Q10. WAP to find the second largest no. among 3 entered nos.

#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
int a,b,c,d;
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
d=a>b?(a>c?c:a):(b>c?c:b);
cout<<d<<" is second largest ";
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...