Don't pay attention some antivirus programs recognize the compiled items as virus, it does the same avast with visual studio, just add exception to your antivirus list. But your code has some problems indeed.
for (i = 1; i <= 10; ++i)
is incorrect, because the arrays in C start on 0, and second to initialize variables you don't need to do for loops you can assign them values like any other variable.numbers [i] = temp - 1
The way you store the values in the array is not so good, because you are altering the inputed values when you do -1.
a
/*For the array initialization.*/
int numbers[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
/*For inputing the values.*/
for ( i = 0; i < 10; i++ ){
scanf( "%d", &temp );
if( temp == -1 ){
numbers[ i ] = -1;
break;
else{
numbers[ i ] = temp;
}
}
/*For the printing. */
for( i = 0; i < 10 ; i++ ){
if( numbers[ i ] == -1 ){
break;
}
printf( "numbers[%d] is %d", i, numbers[ i ] );
}