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
What is a vector c++?
Who made c++?
Define a nested class. Explain how it can be useful.
Will c++ be replaced?
What is vector string in c++?
What is class invariant in c++?
Which bitwise operator is used to check whether a particular bit is on or off?
Difference between a homogeneous and a heterogeneous container
What does #define mean in c++?
Can I uninstall microsoft c++ redistributable?
what is a class? Explain with an example.
What is polymorphism & list its types in c++?
What kind of jobs can I get with c++?
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is the function of I/O library in C++ ?