C program to print the length of a given array without using sizeof
codeaft.c
#include<stdio.h>intmain(){intmin,max;intarr[5]={100,15,8,45,93};intlength=*(&arr+1)-arr;printf("Length of a given array is %d",length);return0;}
Output
codeaft@codeaft:~$ gcc codeaft.c codeaft@codeaft:~$ ./a.out
Length of a given array is 5
codeaft@codeaft:~$
Comments and Reactions
Thank You
Dear User, Thank you for visitng Codeaft. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.