Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language inputs an integer array and outputs all the examples in turn.
C language inputs an integer array and outputs all the examples in turn.
Idea: Define a number, input it from the keyboard in turn and assign a value to judge whether it is even or not, and whether it is a number divisible by 2, then use if(n%2==0) to judge whether it is even or not, and if it is, output it.

Reference code:

# Contains? “stdio.h”?

# Contains? “string.h”?

int? main()? {

int? a[ 10],I;

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

scanf("%d ",& ampa[I]); //Keyboard input?

Is If(a[i]%2==0)// even?

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

}

printf(" \ n ");

Return? 0;

}

/*

Running results:

0? 1? 2? 3? 4? 5? 6? 7? 8? nine

0? 2? 4? 6? 8?

*/