int getvalue(int *arr_value, int number)
{
int i = 0;
int temp =0;
while(i < number)
{
if((scanf("%d",temp)) == 1) // to check whether input is integer
{
arr_value[i++] = temp; // to store it in array only if it is int
}
else
{
printf("\n Enter a proper integer: ");
continue;// go to the loop again to prompt value from user
}
}
for(i =0 ; i < number; i++)
{
printf("%d",arr_value[i]);
}
}
/* this program runs the enter integer line infinitely,
although I tried it with a continue statement.*/