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
What functions are in conio h?
Explain the binary height balanced tree?
Describe how arrays can be passed to a user defined function
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What are the different types of control structures?
what is reason of your company position's in india no. 1.
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What is a function in c?
What are logical errors and how does it differ from syntax errors?
If null and 0 are equivalent as null pointer constants, which should I use?
What is the difference between exit() and _exit() function in c?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is this pointer in c plus plus?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is call by reference in functions?