Answers for "Call by reference to pass an array to the function in C-"

C
1

Call by reference to pass an array to the function in C-

#include <stdio.h>
void display( int *powers)
{
printf("%d ", *powers);
}
int main()
{
printf("Welcome to Dataflair tutorials!\n\n");
int i;
int array[] = {1, 2, 4, 9, 25, 36, 49, 64, 81, 100};
for (i=0; i<10; i++)
{
display(&array[i]); // Passing the address of array to the function
}
return 0;
}
Posted by: Guest on April-02-2022

Code answers related to "Call by reference to pass an array to the function in C-"

Code answers related to "C"

Browse Popular Code Answers by Language