#include<iostream>
using namespace std;

int smallestValue(int[],int);

int main()
{
	const int SIZE =8;
	int num [SIZE]= {1,2,4,5,10,100,2,22};
	
	cout<<"The index of smallest number is : ";
	cout<<smallestValue( num, SIZE)<<endl;
	
	return 0;
	
}

int smallestValue(int array[], int size)
{
	int small, index =0 ,i ,count=0;
	small=array[0];
	
	for(i=1 ; i<size ;i++)
	{
		if(array[i]< small)
			small=array[i];
	}
	
	for(i=0;i<size;i++)
	{
		if(array[i]!=small)
			index++;
			
		else break;
		
	}
	
	return index;
}
