C Program to find maximum element in an array without sorting

Program

#include<stdio.h>
void main()
{
	int a[10], size, i, max, location;
	printf("Enter the size of the array\n");
	scanf("%d", &size);
	printf("Enter %d elements\n", size);
	for(i = 0; i < size; i++)
		scanf("%d", &a[i]);
	max = a[0];
	location = 1;
	for(i = 1; i < size; i++)
	{
		if(a[i] > max)
		{
			max = a[i];
			location = i;
		}
	}
	printf("Maximum element in the array is: %d and is present in location %d\n", a[location], location + 1);
}

Output

Enter the size of the array
6
Enter 6 elements
12
3
90
45
67
48
Maximum element in the array is: 90 and is present in location 3