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

Is register a keyword in c?

1028


How can you invoke another program from within a C program?

1057


What is local and global variable in c?

1177


What are the types of functions in c?

974


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1043


How can I remove the leading spaces from a string?

1139


Do pointers store the address of value or the actual value of a variable?

1065


What is malloc and calloc?

1037


Why c is called a mid level programming language?

1056


Explain indirection?

1107


What are the application of void data type in c?

1167


what is ur strangth & weekness

2397


What is data structure in c and its types?

1055


What is pointers in c with example?

1052


Why is C language being considered a middle level language?

1108