ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE
GIVEN VALUES
 Question Submitted By :: Taj
I also faced this Question!!     Rank Answer Posted By  
 
  Re: WRITE A C PROGRAM TO FIND SECOND BIGGEST VALUE FROM THE GIVEN VALUES
Answer
# 1
#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 ?    6 Yes 7 No
Naveen
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is a c-language.what is do. HCL3
what is the code for getting the output as * ** *** Caritor5
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above Accenture3
define function Assurgent4
What is the difference between typeof(foo) and myFoo.GetType()?  1
biggest of two no's with out using if condition statement  2
how to print a statement in c without use of console statement ,with the help of if statement it should print Satyam2
which one low Priority in c? a)=,b)++,c)==,d)+  8
what is op? for(c=0;c=1000;c++) printf("%c",c); Trigent18
What's the difference between a linked list and an array?  11
how to make program without <> in library. ADITI1
Total of how many functions are available in c?  2
what are brk, sbrk? Oracle1
how to convert an char array to decimal array  3
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV Accenture4
will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);  2
How can draw a box in cprogram without using graphics.h header file & using only one printf(); ? NIIT1
program to find middle element of linklist? Huawei1
can i know the source code for reversing a linked list with out using a temporary variable? Honeywell6
what is meant by c  4
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com