Answers for "how to write function get array integer from user in c"

C
13

take array as input in c

int size=5;
int array[size]; // array of size=5;

for(i=0;i<size;i++){
   scanf("%d",&array[i]);
                }
Posted by: Guest on November-05-2020
8

array value from user c

#include <stdio.h>
int main(void)
{
int size, i;
printf("Enter the size of the arrays:\n");
scanf("%d", &size);

int arr1[size];
printf("Enter the elements of the array:\n");
for (i = 0; i < size; i++) {
    scanf_s("%d", arr1[size]);
}
printf("The current array is:\n %d", arr1[i]);
}
Posted by: Guest on September-21-2020

Code answers related to "how to write function get array integer from user in c"

Code answers related to "C"

Browse Popular Code Answers by Language