find second largest element in array w/o using sorting
techniques? use onle one for loop.
Answer Posted / ramesh
this is to largest element in an array using one loop concept:
for(int i=0;i<=arr.length;i++)
{
if(a[i]>a[i+1])//if first position element is large we want swap that element
{
t =a[i];
a[i] =a[i+1];
a[i+1]=t;
}
printf("%d",a[i+1]);
by
97894 33227
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
Give basis knowledge of web designing ...
how is the examination pattern?
What is c standard library?
write a c program to find the sum of five entered numbers using an array named number
What are inbuilt functions in c?
What is the use of pointers in C?
Is register a keyword in c?
What is difference between array and pointer in c?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
How to get string length of given string in c?
What is omp_num_threads?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What are the application of c?
What is array within structure?