I will mark as brainliest. Pls give ans. @aryamohanan112
Attachments:
Answers
Answered by
1
pass the numbers to be added as array..
the function is as follows
int Add(int arr[],int n)
{
int sum=0;
for(int i=0;i<n;i++)
{
sum=sum+arr[i];
}
return sum;
}
the arguments are the array of numbers to be added and total no of numbers
hope this help you
the function is as follows
int Add(int arr[],int n)
{
int sum=0;
for(int i=0;i<n;i++)
{
sum=sum+arr[i];
}
return sum;
}
the arguments are the array of numbers to be added and total no of numbers
hope this help you
Artybabe:
Where r the 2, 3 and 4 numberss in this program. Pls give the exact program
Answered by
1
int add(int,int,int);
void main()
{
int x,y,z;
printf("Enter 1st, 2nd, 3rd numbers: ");
scanf("%d %d %d",&x,&y,&z);
int sum;
sum = add(x,y,z);
printf("Sum = %d", sum);
getch();
}
add(int a,int b,int c)
{
int hell;
hell = a + b + c;
return(hell);
}
Hope this helps!
void main()
{
int x,y,z;
printf("Enter 1st, 2nd, 3rd numbers: ");
scanf("%d %d %d",&x,&y,&z);
int sum;
sum = add(x,y,z);
printf("Sum = %d", sum);
getch();
}
add(int a,int b,int c)
{
int hell;
hell = a + b + c;
return(hell);
}
Hope this helps!
Similar questions
Math,
8 months ago
Science,
8 months ago
English,
8 months ago
Social Sciences,
1 year ago
Chemistry,
1 year ago