1 & 3

mail@pastecode.io avatar
unknown
c_cpp
3 years ago
400 B
2
Indexable
Never
#include<stdio.h>
#include<stdlib.h>

int main(int argc,char** argv)
{
    int n,i,*arr;
    printf("Enter number of elements: ");
    scanf("%d",&n);
    arr=(int*)malloc(n*sizeof(int));

    printf("Enter elements of array: ");
    for(i=0;i<n;++i)
    {
        scanf("%d",arr+i);
    }
    for(int i=0;i<n;i++)
            printf("%d ",arr[i]);
    free(arr);
    return 0;
}