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...


find largest element in array w/o using sorting techniques.

Answers were Sorted based on User's Feedback



find largest element in array w/o using sorting techniques...

Answer / pramod

#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 ?    27 Yes 2 No

find largest element in array w/o using sorting techniques...

Answer / gganesh

#include<stdio.h>
#include<conio.h>
#define max 100
void main()
{
int i,j,k,num[max];
clrscr();
printf("\nEnter the number one by one and terminate with
0\nDont enter more than %d numbers\n\n",max);
i=0;
do
{
printf("Enter the number : ");
scanf("%d",&num[i]);
i++;
}while(num[i-1]!=0);
j=num[0];
for(k=1;k<i;k++)
if(j<num[k])
j=num[k];
printf("\nLargest number : %d",j);
getch();
}

Is This Answer Correct ?    3 Yes 0 No

find largest element in array w/o using sorting techniques...

Answer / manjunath

#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 ?    3 Yes 7 No

Post New Answer

More C Interview Questions

write a c program to print "Welcome" without using semicolon in the whole program ??

15 Answers   Infosys, TCS,


two variables are added answer is stored on not for third variable how it is possible?

3 Answers  


Write programs for String Reversal & Palindrome check

0 Answers   TISL,


What are different storage class specifiers in c?

0 Answers  


main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }

5 Answers   Amazon, HCL, Thought Works,


How many levels of indirection in pointers can you have in a single declaration?

0 Answers   Agilent, ZS Associates,


change to postfix a/(b+c*d-e)

8 Answers   Value Labs,


What is the code for 3 questions and answer check in VisualBasic.Net?

0 Answers   Infosys,


What is difference between scanf and gets?

0 Answers  


What is static and volatile in c?

0 Answers  


What is the difference between CV and Resume ?

2 Answers  


Explain what is the concatenation operator?

0 Answers  


Categories