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
Can we add pointers together?
Explain what is the use of a semicolon (;) at the end of every program statement?
Is that possible to store 32768 in an int data type variable?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
Which is better pointer or array?
How can I determine whether a machines byte order is big-endian or little-endian?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
What is the use of function in c?
How can I manipulate strings of multibyte characters?
What is the difference between scanf and fscanf?
How old is c programming language?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
Explain how do you use a pointer to a function?
Write a program to show the change in position of a cursor using c