Hey, guys, I need a little help. I want to send functions to a double-dimensional array in c programming language. But I don’t know how.
Can you give me an example?
Thanks.
Hey, guys, I need a little help. I want to send functions to a double-dimensional array in c programming language. But I don’t know how.
Can you give me an example?
Thanks.
#include <stdio.h>
int addNumbers(int a, int b); // function prototype
int main()
{
int n1,n2,sum;
printf(“Enters two numbers: “);
scanf(”%d %d”,&n1,&n2);
sum = addNumbers(n1, n2); // function call
printf(“sum = %d”,sum);
return 0;
}
int addNumbers(int a, int b) // function definition
{
int result;
result = a+b;
return result; // return statement
}
I think this would help you.
Also, for future reference, using ALL CAPS is considered “shouting” and should be avoided for politeness.