Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE
GIVEN VALUES

WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES..

#include<stdio.h>
#include<math.h>
void main()
{
int a[],n,b;
printf("Enter the number of digits you want to enter:");
scanf(%d",&n);
printf("Enter the different values you want:")
for(i=0;i<=n;i++)
{
scanf(%d",a[i]);
}
/* This will make the values to be arranged in descending
order*/
for(i=0;i<=n;i++)
{
if(a[i] >> a[i+1])
{

}
else
{
b = a[i];
a[i] = a[i+1];
a[i+1] = b;
}
}
/* As a[0] will be the max value the next to it a[1] will be
second highest*/
printf("The second largest value will be: %d",&a[1]);
}

 Is This Answer Correct ? 36 Yes 42 No

More C Interview Questions

1.find the second maximum in an array? 2.how do you create hash table in c? 3.what is hash collision

why array index always starts from zero??

Explain how do you determine whether to use a stream function or a low-level function?

how will you write a program on linked lists using JAVA programming???????????

C program to find all possible outcomes of a dice?

Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

write a program to display the frequency of each element in a given array in c language

Do pointers need to be initialized?

What is the meaning When we write "#include" what is # and what does include does there???

WHAT IS MEANT BY LIFE?

what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

Categories