c define array size
#include <stdio.h>
#define SIZE 5
int main() {
int arr[SIZE];
printf("Size of array: %d\n", SIZE);
return 0;
}
Explanation:
#include <stdio.h>
: Includes the standard input-output header file for input and output operations.#define SIZE 5
: Defines a constantSIZE
with a value of5
.int main() { ... }
: The main function where the program execution begins.int arr[SIZE];
: Declares an integer arrayarr
of sizeSIZE
, which is5
in this case.printf("Size of array: %d\n", SIZE);
: Prints the size of the array using the%d
format specifier in theprintf
function.return 0;
: Indicates successful termination of themain
function and the program overall.