Write a program that read 2o numbers in and array and
output the second largest number. Can anybody help??
Answer Posted / fahad
#include<iostream.h>
void main()
{
int a[20];
int i;
for(i=o ; i<20 ;i++)
cin>>a[i];
}
int(max=a[0];
for(i=1; i<20; i++)
{
if(a[i]>max) max=a[i];
}
cout<<"\n maimun number is ="<< max<<"\n";
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Differentiate between a constructor and a destructor in c++.
How can virtual functions in c++ be implemented?
Which bitwise operator is used to check whether a particular bit is on or off?
What does floor mean in c++?
Can we specify variable field width in a scanf() format string? If possible how?
Why do we use iterators?
What flag means?
When do you call copy constructors?
Is atoi safe?
Why is main an int?
Is C++ case sensitive a) False b) Depends on implementation c) True
What is a memory leak c++?
Define token in c++.
Why is c++ still best?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list