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
Is null always equal to 0(zero)?
Explain 'bus error'?
Which header file is used for clrscr?
What is the difference between void main and main in c?
What is the use of f in c?
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)
What is a loop?
What is nested structure?
Are pointers integer?
How many keywords are there in c?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Is it possible to pass an entire structure to functions?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
What does emoji p mean?
How do you search data in a data file using random access method?