Answer Posted / rw-rwx
This might help.
max1=a[0];max2=a[1];
for(i=1;i<n;i++)
{
if(max1<a[i])
{
max2=max1;
max1=a[i];
}
if(max2==max1) max2=a[i+1];
if(max2==a[n]) { printf("All numbers are the same no second max.\n"); return 0;}
if(max2<a[i] && max1!=a[i]) max2=a[i];
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How did c++ get its name?
List down the guideline that should be followed while using friend function.
Is swift a good first language?
What are the vectors in c++?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
Why c++ is so important?
Explain the isa and hasa class relationships.
Write a program to show polymorphism in C++?
How come you find out if a linked-list is a cycle or not?
What is c++ library?
What is == in programming?
Do you need a main function in c++?
Is c++ an oop?
what is COPY CONSTRUCTOR and what is it used for?
Describe about storage allocation and scope of global, extern, static, local and register variables?