Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE
GIVEN VALUES



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

Post New Answer

More C Interview Questions

find largest of 3 no

8 Answers  


while initialization of array why we use a[][2] why not a[2][]...?

0 Answers   Aptech,


Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.

2 Answers  


tell me the full form of c?

2 Answers  


Differentiate Source Codes from Object Codes

1 Answers  


Explain how can you avoid including a header more than once?

0 Answers  


Is a pointer a kind of array?

0 Answers  


can v write main() { main(); } Is it true?

6 Answers  


Write programs for String Reversal & Palindrome check

0 Answers   TISL,


what is the use of ‘auto’ keyword?

1 Answers  


what is difference between ++(*p) and (*p)++

17 Answers   Accenture, HCL, IBM,


What is the size of structure in c?

0 Answers  


Categories