find second largest element in array w/o using sorting
techniques? use onle one for loop.
Answer Posted / guest
max = 2ndmax= array[0];
for (i=0;i,length;i++)
{
if (array[i]>max)
{
2ndmax=max;
max=array[i];
}
}
return 2nd max
Is This Answer Correct ? | 40 Yes | 74 No |
Post New Answer View All Answers
write a programming in c to find the sum of all elements in an array through function.
What is bubble sort technique in c?
Explain what are bus errors, memory faults, and core dumps?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is null pointer in c?
What is the difference between malloc() and calloc() function in c language?
Describe wild pointers in c?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
Why is C language being considered a middle level language?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
How can you tell whether a program was compiled using c versus c++?
How can you invoke another program from within a C program?
Explain what is the difference between the expression '++a' and 'a++'?
What is string concatenation in c?