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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always equal to 0(zero)?

1002


Explain 'bus error'?

1033


Which header file is used for clrscr?

1013


What is the difference between void main and main in c?

1115


What is the use of f in c?

943


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

2073


What is a loop?

973


What is nested structure?

1009


Are pointers integer?

969


How many keywords are there in c?

1034


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

1059


Is it possible to pass an entire structure to functions?

956


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2255


What does emoji p mean?

1056


How do you search data in a data file using random access method?

1266