C program to print the length of a given array without using sizeof
kw.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
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
Length of a given array is 5
kodingwindow@kw:~$
Comments and Reactions
Advertisement
Thank You
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the KodingWindow Android app. We intend to soon make it available on the Google Play Store. Currently, you need to install apk manually. Would you like to get the app? Minimum Requirement(s): Android 10