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
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
Is there any data type in c with variable size?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What language is lisp written in?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
Is c dynamically typed?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
Is c procedural or object oriented?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Why header files are used?
Is python a c language?
What does printf does?
Write a program to show the change in position of a cursor using c