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
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
When should overload new operator on a global basis or a class basis?
How does a C++ structure differ from a C++ class?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
What is new in c++?
What are the advantage of using register variables?
Describe protected access specifiers?
Do class declarations end with a semicolon? Do class method definitions?
Which is the best c++ compiler?
What are pointer-to-members? Explain.
How do you clear a set in c++?
Is c++ low level?
How do you flush std cout?
What is std namespace in c++?
Write about the local class and mention its use?