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 |
What does c in a circle mean?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Why isn't any of this standardized in c? Any real program has to do some of these things.
what is a function pointer and how all to declare ,define and implement it ???
what is the code to display color fonts in the output?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
What is the method to save data in stack data structure type?
what are the facialities provided by you after the selection of the student.
#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.
What is string function c?
Why array starts with index 0