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 |
Write a pro-gramme to determine whether the number is even or odd?
Explain what is wrong with this program statement?
What is information technology.
What are the different file extensions involved when programming in C?
Hai friends im a i year student. i want to develop my knowledge in the field of TSR in c. How I'm Improve ?
When should a type cast be used?
Explain how can I prevent another program from modifying part of a file that I am modifying?
Which is an example of a structural homology?
what are the languages used in c#?
6)swap(int x,y) { int temp; temp=x; x=y; y=temp; } main() { int x=2;y=3; swap(x,y); } after calling swap ,what are yhe values x&y?
why Language C is plateform dependent
Tell me when is a void pointer used?