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
Can we use any name in place of argv and argc as command line arguments?
What is cohesion in c?
What is keyword in c?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is the size of structure pointer in c?
Why shouldn’t I start variable names with underscores?
Explain the meaning of keyword 'extern' in a function declaration.
What is the scope of an external variable in c?
Difference between exit() and _exit() function?
Write a program to print factorial of given number without using recursion?
What are identifiers and keywords in c?
What are comments and how do you insert it in a C program?
Where is volatile variable stored?
What is the use of linkage in c language?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)