Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to assign values to array input in C language and find the code?
How to assign values to array input in C language and find the code?
# include & ltstdio.h & gt

int main(void)

{

int a[5];

Printf ("Please enter 5 numbers:");

for(int I = 0; I<5; i++) {?

scanf("%d ",& ampa[I]);

}

for(I = 0; I<5; i++) {

printf("%d ",a[I]);

}

printf(" \ n ");

Returns 0;

}

Extended data:

For loop

For loop is an open loop statement in programming language, and loop statement? [ 1]? It consists of a loop body and a loop termination condition. The realization and expression of for loop in various programming languages are different, but they are basically expressed in C language and pascal language.

The form of for loop in C language is:

For (single expression; Conditional expression; End loop)

{

Intermediate circulation body;

}

The first ";" In parentheses in the for loop. The symbol is preceded by a single expression that does not participate in the loop, which can be used as an initialization assignment statement of the variable to assign an initial value to the loop control variable; It can also be used to evaluate expressions that are not related to the for loop but are processed before the loop part.

The executed intermediate loop body can be one statement or multiple statements. When there is only one statement in the middle loop body, you can omit the braces {} and execute the last loop body after the middle loop body is executed.

References:

For loop- Baidu encyclopedia