Find Largest Value In Array Using Recrsion In C Program Tamil


#include<stdio.h>
#include<conio.h>
int large(int [],int,int);
void main()
{
	int a[10],i,n,l;
	clrscr();
	printf("\nEnter the limit :");
	scanf("%d",&n);
	printf("Enter %d numbers: ",n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	l=a[0];
	printf("\nlargest value : %d",large(a,n,l));
	getch();
}
int large(int a[10],int n,int l)
{
	if(n==1)
	{
		return l;
	}
	else if(n>=0)
	{
	 if(l<a[n])
	 {
	   l=a[n];
	 }
	 return (l=large(a,n-1,l));
	}
	else
	{
		return l;
	}
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming