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...

Find greatest number out of 10 number without using loop.

Answer Posted / ashwin

#include<stdio.h>
int MAX(int a,int b)
{
if(a>b)
return a;
else
return b;
}

int max(int a[],int n)
{
if(n==1)
return a[0];
else
return MAX(a[n-1],max(a,n-1));
}
int main()
{
int a[]={3,5,1,5,7,3,9,0,2,6};
int n=10,big;
big=max(a,n);
printf("%d",big);
return 0;
}

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the message "automatic aggregate intialization is an ansi feature" mean?

1157


Explain enumerated types.

996


what is event driven software and what is procedural driven software?

2521


How do you sort filenames in a directory?

1135


Write a program to implement queue.

1083


What is p in text message?

949


When can a far pointer be used?

989


How can my program discover the complete pathname to the executable from which it was invoked?

1045


What are data structures in c and how to use them?

1123


How many loops are there in c?

1068


What does %d do?

1224


What does volatile do?

959


What is the difference between void main and main in c?

1122


code for find determinent of amatrix

1931


What is identifiers in c with examples?

1143