Answer Posted / navs
if we take the array as
arr[]={1,4,7,2,10,0,6}
get the count
int count =6;
int max =arr[0];
int smax;
for (i=0;i<=count;i++)
{
if(max<arr[i])
{
smax=max;
max=max[i];
}
}
smax would give the second largest number
| Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
Should I learn c or c++ first?
What are the characteristics of friend functions?
Write about a nested class and mention its use?
What is the difference between cin.read() and cin.getline()?
How to implement is-a and has-a class relationships?
What does it mean to declare a destructor as static?
Is std :: string immutable?
How to declare a pointer to an array of integers?
What is setiosflags c++?
What are built-in functions? What is the syntax for the definition?
Explain pass by value and pass by reference.
Describe private, protected and public – the differences and give examples.
What is public, protected, private in c++?
How is data hiding achieved in c++?
Difference between pointer to constant and constant pointer to a constant. Give example.