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?
the first character in the variable name must be an a) special symbol b) number c) alphabet
how to access grid view row?
List the special characteristics of constructor.
What is difference between class and function?
What is a linked list in c++?
Explain the difference between overloading and overriding?
Write a program to concatenate two strings.
Is swift faster than go?
In a function declaration, what does extern mean?
Which ide is best for c++?
what does the following statement mean? int (*a)[4]
Is c++ map a hash table?
What is an arraylist c++?
What are the two types of comments?