C Program to find the size of the array


This content was proof-read by Grammarly. You can Try Grammary for FREE

Problem Statement

Write a program in C to find the array size.

How to find the size of the array in C ?

#include <stdio.h> 
int main()  
{ 
  int length;
  int arr[2]= { 2, 3 }; 
  length = sizeof(arr)/sizeof(int); 
  printf("The length of Array is %d", length); 
  return 0; 
}

 

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

Newsletter Signup

Subscribe to our weekly newsletter below and never miss the latest product or an exclusive offer.

%d bloggers like this: