how to find the largest element of array without using relational operater?
Answer Posted / upendra singh and avinash cho
#include<stdio.h>
#include<string.h>
void main()
{
int arr[4]={1,10,5,4},c,i,k,j=1;
k=arr[0];
for( i=0;i<3;i++)
{ c=k-arr[i+1];
c=c>>15;
if(c)
k=arr[i+1];
}
printf("largest number %d",k);
getch();
}
Is This Answer Correct ? | 25 Yes | 11 No |
Post New Answer View All Answers
What is the use of a semicolon (;) at the end of every program statement?
What are the 3 types of structures?
Explain how can type-insensitive macros be created?
Why is c used in embedded systems?
How do you override a defined macro?
What is the process to create increment and decrement stamen in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Difference between malloc() and calloc() function?
Differentiate Source Codes from Object Codes
Explain what are preprocessor directives?
Explain what is the difference between far and near ?
what is the diffrenet bettwen HTTP and internet protocol
What is difference between static and global variable in c?
What is the difference between text files and binary files?
Differentiate between the expression “++a” and “a++”?