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
Can I learn c++ without knowing c?
What is the latest c++ standard?
Is it possible for the objects to read and write themselves?
How can you say that a template is better than a base class?
What are the different types of comments allowed in c++?
What is ios in c++?
What are the classes in c++?
what Is DCS ? what i will get benefit when i did?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
What does new in c++ do?
What is binary object model?
Explain the concept of friend function in c++?
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
What are the unique features of C++.
Explain the uses oof nested class?