#include <stdio.h> #include <stdlib.h> int main(){ //printf("The size of int in your computer is %d\n",sizeof(int)); // printf("The size of float in your computer is %d\n",sizeof(float)); // printf("The size of char in your computer is %d\n",sizeof(char)); int * ptr; int n; printf( "Enter the size of array:\n" ); scanf( "%d" ,&n); ptr=( int *) calloc(n, sizeof ( int )); for ( int i= 0 ;i<n;i++) { printf( "Enter the value of element %d:\n" ,i+ 1 ); scanf( "%d" ,&ptr[i]); } for ( int i= 0 ;i<n;i++) { printf( "The value of element %d is:%d\n" ,i+ 1 ,ptr[i]); } return 0 ; }
Comments
Post a Comment