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
Is c++ a programming language?
Why is standard template library used?
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
What would happen on forgetting [], while deallocating an array through new?
How do you define/declare constants in c++?
How does java differ from c and c++?
Do inline functions improve performance?
What is the identity function in c++? How is it useful?
What are all predefined data types in c++?
Do the parentheses after the type name make a difference with new?
Describe friend function & its advantages.
When does a 'this' pointer get created?
What are the sizes and ranges of the basic c++ data types?
Is c++ a dying language?