This C program counts the number of elements in an integer array called arr, which contains the elements 10, 20, 30, 40, and 50. It uses the sizeof operator to determine the total size of the array in bytes and divides it by the size of an integer to get the element count, which it stores in the variable n and prints out. The program then returns 0 to indicate it executed successfully.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
46 views1 page
Array
This C program counts the number of elements in an integer array called arr, which contains the elements 10, 20, 30, 40, and 50. It uses the sizeof operator to determine the total size of the array in bytes and divides it by the size of an integer to get the element count, which it stores in the variable n and prints out. The program then returns 0 to indicate it executed successfully.