Develop a C program to initialize the array dynamically and display its elements.
Code
#include <stdio.h>int main(){int size; //array sizeprintf("Enter the value of arr size ");scanf("%d", &size); //input array sizeint arr[size];for (int i = 0; i < size; i++){printf("Enter array value\t");scanf("%d", &arr[i]); //input array value}for (int i = 0; i < size; i++){//output array valueprintf("Value of array is %d \n", arr[i]);}return 0;}
Allocation is static
Output
lol
0 Comments
Post a Comment