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 |
1)what are limitations for recursive function? 2)write a program to read a text file and count the number of characters in the text file
Explain what are the __date__ and __time__ preprocessor commands?
How can I set an array's size at run time?
plz answer.. a program that takes a string e.g. "345" and returns integer 345
Write a program to add a given duration with time(24hrs format)
what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it
What is the difference between abs() and fabs() functions?
what is mallloc()?how it works?
post new interiew question and aptitude test papers
what is d pitfalls of registers variables
what is use#in c
What are Macros? What are its advantages and disadvantages?