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 |
Explain how can type-insensitive macros be created?
Explain how do you determine a file’s attributes?
Why does the call char scanf work?
Can U write a C-program to print the size of a data type without using the sizeof() operator? Explain how it works inside ?
how to get starting address of a running C program
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
how to do in place reversal of a linked list(singly or doubly)?
How can type-insensitive macros be created?
Explain how do you declare an array that will hold more than 64kb of data?
can you explain in brief what is "r+" mode in a file... i know that it si used to read and modify rhe existing content.... but explalanation about the file pointer in "r+" mode i wann to know???????????
What is console in c language?
how many header file is in C language ?
44 Answers College School Exams Tests, CTS, IBM, IMS, Infosys, ME, Sign Solutions, Wipro, XVT,