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

How can I read data from data files with particular formats?

1051


What is array of structure in c programming?

1295


What does *p++ do?

1029


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1397


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2266


Here is a neat trick for checking whether two strings are equal

1023


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2333


Explain how to reverse singly link list.

1154


Explain the difference between strcpy() and memcpy() function?

1024


write a c program to find the sum of five entered numbers using an array named number

2145


Difference between constant pointer and pointer to a constant.

1157


Why enum is used in c?

970


What is wrong with this initialization?

1014


What are Macros? What are its advantages and disadvantages?

1168


What are the keywords in c?

1129