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
Why #include is used in c language?
Explain two-dimensional array.
Explain void pointer?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
How can I pad a string to a known length?
What is union and structure?
is it possible to create your own header files?
What does sizeof int return?
show how link list can be used to repersent the following polynomial i) 5x+2
What is extern c used for?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Hai what is the different types of versions and their differences
What is integer constants?
What does s c mean in text?
Why static is used in c?