suppose there are five integers write a program to find
larger among them without using if- else
Answer Posted / icywind
#include <stdio.h>
#define SIZE 5
int main(void)
{
int array[] = {100, 32, 22, 500, 21};
int max=0,ii;
for( ii = 0; ii<SIZE; ii++)
{
max = (array[ii]>max)?array[ii]:max;
}
printf("max = %d\n", max);
return 0;
}
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is the role of this pointer?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
What is binary tree in c?
Explain bit masking in c?
Explain what are header files and explain what are its uses in c programming?
Explain is it better to bitshift a value than to multiply by 2?
Is this program statement valid? INT = 10.50;
will u please send me the placement papers to my mail???????????????????
What are nested functions in c?
List the difference between a "copy constructor" and a "assignment operator"?
How to throw some light on the b tree?
Where define directive used?
What are the two types of structure?
Is it possible to pass an entire structure to functions?
Apart from dennis ritchie who the other person who contributed in design of c language.