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
Mention the purpose of istream class?
How can I learn c++ easily?
what is the difference between overloading & overriding? give example.
You run a shell on unix system. How would you tell which shell are you running?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
What is the keyword auto for?
What are the various compound assignment operators in c++?
What is a friend function in c++?
Is python written in c or c++?
Describe private, protected and public – the differences and give examples.
What is the basic structure of c++ program?
Discuss the possibilities related to the termination of a program before entering the mainq method?
When is the copy constructor called?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero
Describe new operator?