Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I copy files?

1052


What do the functions atoi(), itoa() and gcvt() do?

1182


What is the function of this pointer?

1331


Explain what is a static function?

1107


Differentiate between a for loop and a while loop? What are it uses?

1174


What does the file stdio.h contain?

1056


Why is C language being considered a middle level language?

1121


Why we write conio h in c?

1029


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

3290


Why should I prototype a function?

1185


What is build process in c?

1148


What is the most efficient way to count the number of bits which are set in an integer?

1050


What is the difference between Printf(..) and sprint(...) ?

1527


How can I pad a string to a known length?

1032


How pointers are declared?

952