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


Please Help Members By Posting Answers For Below Questions

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

627


What is call by value in c?

563


What is keyword with example?

646


When is a void pointer used?

682


What are different types of pointers?

566






What language is lisp written in?

622


What tq means in chat?

584


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'); }

702


Explain argument and its types.

608


What is the heap?

690


When should I declare a function?

627


What is the stack in c?

723


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7413


Why static variable is used in c?

561


Difference between Function to pointer and pointer to function

636