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 bit fields? What is the use of bit fields in a structure declaration?
What is the advantage of c?
State the difference between x3 and x[3].
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is calloc in c?
How can you increase the size of a dynamically allocated array?
What is the difference between union and structure in c?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
If I have a char * variable pointing to the name of a function ..
What is time complexity c?
How can I do graphics in c?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
What does 3 mean in texting?
What is declaration and definition in c?
Is python a c language?