WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE
GIVEN VALUES
Answer / naveen
#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 |
find largest of 3 no
while initialization of array why we use a[][2] why not a[2][]...?
Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.
tell me the full form of c?
Differentiate Source Codes from Object Codes
Explain how can you avoid including a header more than once?
Is a pointer a kind of array?
can v write main() { main(); } Is it true?
Write programs for String Reversal & Palindrome check
what is the use of ‘auto’ keyword?
what is difference between ++(*p) and (*p)++
17 Answers Accenture, HCL, IBM,
What is the size of structure in c?