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
Do you know what are the properties of union in c?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is the translation phases used in c language?
What is a char c?
What is scope rule of function in c?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
Explain the difference between the local variable and global variable in c?
How many bytes is a struct in c?
what are the different storage classes in c?
what is event driven software and what is procedural driven software?
what are the advantages of a macro over a function?
The statement, int(*x[]) () what does in indicate?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What is meant by keywords in c?