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 value of h?
What is the g value paradox?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Is there anything like an ifdef for typedefs?
how should functions be apportioned among source files?
What is difference between class and structure?
What is calloc()?
What does a function declared as pascal do differently?
What is an identifier?
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.
Explain what does the function toupper() do?
Is null equal to 0 in sql?
What is 02d in c?
What is scope of variable in c?
What is null pointer constant?