Answer the question
In order to leave comments, you need to log in
C - How to make a separate function for array input from the keyboard and a function for output?
Hello, I understand C.
My disassembly led to this code
#include <stdio.h>
void main()
{
int *a;//
int n = 0;//
printf("Введите размерность массива: ");
scanf("%i", &n);
a = (int*)malloc(n * sizeof(int));
for (int i = 0; i<n; i++)
{
printf("a[%i] = ", i);
scanf("%i", &a[i]);
}
free(a);
}
Answer the question
In order to leave comments, you need to log in
compose two functions called in main - a function to input an array of a certain length n, and a function to output an array to the console
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question