/* To find Second Smallest of Ten Numbers */
#include <stdio.h>
main()
{
	int a[10],small=a[0],second_small=a[0],i;
	clrscr();
	i=0;
	printf("Enter ten Values\n");
	while(i<10)
	{
		scanf("%d",&a[i]);
		i++;
	}
	i=0;	/*Smallest Number Calculation Part */
	while(i<10)
	{
		if (a[i]<small)
			small=a[i];

		i++;
	}
	printf("The Smallest Number is= %d\n",small);
	i=0;	/*Second Smallest Calculation Part */
	while(i<10)
	{
		if (a[i]!=small)
			if (a[i]<second_small)
				second_small=a[i];
		i++;
	}
		printf("The Second Smallest Number is= %d",second_small);

	getch();
}

/* Exercise: 1. Smallest of ten numbers */