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 |
4.A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above
Explain goto?
Differentiate between Macro and ordinary definition.
Explain how can I avoid the abort, retry, fail messages?
Is fortran faster than c?
Does free set pointer to null?
Are global variables static in c?
Explain how do you determine the length of a string value that was stored in a variable?
Explain what is meant by high-order and low-order bytes?
#include<stdio.h> #include<conio.h> void main() { int m=0111,n=20; printf("%d%d\n",m,n); getch(); }
Does c have an equivalent to pascals with statement?
hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a