How to Dynamically Generate Arrays of Specified Size in C Language

How to Dynamically Generate Arrays of Specified Size in C Language
// dynamically generate an array of a specified size in C

#include<stdio.h>
int main()
{
    int i,n;
    printf("Please enter the size of the array:\n");
    scanf("%d",&n);
    
    int Arr[n];
    
    printf("Please enter the elements of the array:\n");
    for (i=0; i<n; i++) {
        scanf("%d",&Arr[i]);
    }
    
    for (i=0; i<n; i++) {
        printf("%d",Arr[i]);
    }
}
Source:ww‮‬w.lautturi.com
Created Time:2017-08-29 04:33:42  Author:lautturi