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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we add pointers together?

1001


Explain what is the use of a semicolon (;) at the end of every program statement?

1186


Is that possible to store 32768 in an int data type variable?

1038


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1457


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1023


Which is better pointer or array?

978


How can I determine whether a machines byte order is big-endian or little-endian?

1006


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

2402


What is the use of function in c?

1145


How can I manipulate strings of multibyte characters?

1081


What is the difference between scanf and fscanf?

1202


How old is c programming language?

969


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1708


Explain how do you use a pointer to a function?

1056


Write a program to show the change in position of a cursor using c

999