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 far pointer? where we use it?
What can I safely assume about the initial values of variables which are not explicitly initialized?
What is the main purpose of c++?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What is c++ used for in games?
Explain rethrowing exceptions with an example?
What is an undefined reference/unresolved external symbol error and how do I fix it?
What are the rules about using an underscore in a c++ identifier?
How do you establish an is-a relationship?
Define a conversion constructor?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
Explain the use of vtable.
What is the use of "new" operator?
Are c and c++ similar?
What's c++ used for?