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                      
tip   SiteMap shows list of All Categories in this site.
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
find largest element in array w/o using sorting techniques.
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: find largest element in array w/o using sorting techniques.
Answer
# 1
#include<stdio.h>


int main()
{
     int a[10]={13,12,34,56,73,21,234,5,76,2};
     int tmp,i;
     tmp=a[0];
     for(i=0;i<=9;i++)
     {
         if(a[i]>tmp)
         {
           tmp=a[i];
         }
     }
    printf("\n largest number is %d\n",tmp);
    return 0;
}
 
Is This Answer Correct ?    8 Yes 0 No
Pramod
 
  Re: find largest element in array w/o using sorting techniques.
Answer
# 2
#include<stdio.h>
void main()
{
int a,b[4]={3,2,7,4,9};
a[0]=b[0];
for(i=1;i<5;i++)
{
if(a<b[i])
{
a=b[i];
}
}
printf("the largest num is %d",a);
}
 
Is This Answer Correct ?    0 Yes 0 No
Manjunath
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How can I access memory located at a certain address?  2
how to generate the length of a string without using len funtion?  3
what is data structure  4
How does free() know how many bytes to free?  5
what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year TCS4
how to find the binary of a number? Infosys5
what is differnence b/w macro & functions  1
Software Interview Questions CAT1
What's the best way to declare and define global variables?  5
What is the main differences between C and Embedded C?  2
write a fuction for accepting and replacing lowercase letter to'Z' with out using inline function. Temenos4
palindrome for strings and numbers----Can anybody do the prog? TCS6
what are the various memory handling mechanisms in C ? HP3
How the processor registers can be used in C ? HP4
What compilation do? Geometric-Software7
what's the o/p int main(int n, char *argv[]) { char *s= *++argv; puts(s); exit(0); } Motorola1
x=2,y=6,z=6 x=y==z; printf(%d",x) HCL8
In scanf h is used for BFL2
what is the difference between these initializations? Char a[]=”string”; Char *p=”literal”; Does *p++ increment p, or what it points to?  2
what is self refrential structure HCL2
 
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