Question: int main ( ) { int values [ 3 ] = ( 3 , 1 0 , 6 ) ; / / array declaration and

int main()
{
int values[3]=(3,10,6); //array declaration and initialization of values
int counter; //control variable for loop to step through each array element
for(counter=0; counter <=2; counter++)//loop to stop through each array element displaying the value stored in the elements
{
printf("The value in element %d of the initialized array is: %d
", counter, values[counter]);
}
values[0]=15; //using assignment statement to set values into each array element
values[1]=18;
values[2]=19;
printf("
"); //used for formatting purposes
for(counter=0; counter <=2; counter++)//loop to step through each array element displaying the values stored in the elements
{
printf("The value kin element %d of the assigned values in the array is: %d
", counter, values[counter]);
}
printf("
"); //used for formatting purposes
for(counter=0; counter <=2; counter++)//loop to step through each array element displaying the value the user entered
{
printf("Enter three values: ");
scanf("%d", &values[counter]);
}
printf("
"); //used for formatting purposes
for(counter=0; counter <=2; counter++)//loop to step through each array element displaying the values the user entered
{
printf("The value in element %d of user input is: %d
", counter, values[counter]);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!