I check the code from the beginning and i see my obvious mistakes.Now i scan all the array and keep max(the number) and k(the position) and print them in the end.So i updated and it works :
#include<stdio.h>
void main()
{
int pin[10]={2,4,6,34,56,54,34,23,1,10},i,max,k;
max=pin[0];
for(i=0;i<10;i++)
{
if(pin[i]>=max)
{
max=pin[i];
k=i;
}
}
printf("The max number of the array is: %d and it is in %d position of the array\n",max,k+1);
} Thanks for your reply