C Program to print if the architecture is supporting big endian or little endian

Program

#include<stdio.h>
#define LITTLE_ENDIAN 0
#define BIG_ENDIAN 1
void main()
{
	int i = 1;
	char *p = (char *)&i;
	if(p[0] == 1)
		printf("This architecture supports Little Endian\n");
	else
		printf("This architecture supports Big Endian\n");
}

Output

This architecture supports Little Endian