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 the use of c++ programming language in real life?
What are vtable and vptr?
What are the differences between malloc() and calloc()?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
How can I disable the "echo" feature?
What is a container class? What are the types of container classes in c++?
Which is better turbo c++ or dev c++?
What is a singleton class c++?
Which is the best c++ software?
What is a stack? How it can be implemented?
What is an iterator?
What is the cout in c++?
Can you please explain the difference between static and dynamic binding of functions?
which operator is used for performing an exponential operation a) > b) ^ c) none
How to tokenize a string in c++?