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 is the difference between void main and main in c?
What is call by value in c?
What is keyword with example?
When is a void pointer used?
What are different types of pointers?
What language is lisp written in?
What tq means in chat?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
Explain argument and its types.
What is the heap?
When should I declare a function?
What is the stack in c?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
Why static variable is used in c?
Difference between Function to pointer and pointer to function