Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago