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 are Macros? What are its advantages and disadvantages?
What does c mean before a date?
Write a program that accept anumber in words
Which is best linux os?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Do character constants represent numerical values?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Apart from dennis ritchie who the other person who contributed in design of c language.
Why isn't it being handled properly?
Tell me the use of bit field in c language?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
Explain how do you print only part of a string?
What do you mean by keywords in c?
Explain do array subscripts always start with zero?
Is struct oop?