Passing array Values Through Function in C Program Tamil


#include<stdio.h>
#include<conio.h>
int add(int [],int);
void main()
{
	int n,i,x,a[100];
	clrscr();
	printf("\n Enter the limit :");
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		printf("\n Enter the values %d :",i+1);
		scanf("%d",&a[i]);
	}
	x=add(a,n);
	printf("\n Total :%d",x);
	getch();

}
int add(int a[],int n)
{
	int i,x=0;
	for(i=0;i<n;i++)
	{
		x=x+a[i];
	}
	return(x);
}

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