Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - In C language, the meaning of if(i%3)
In C language, the meaning of if(i%3)
I%3 is the judgment condition of if statement, and i++ is executed when I is equal to 0, where i= 1, s+=i, S = 1.

Because I

In a word, i++;+; +Execute when I equals 0, 3, 6, 9; s+=i

That is, s= 1+4+7+ 10, which means that s=22.

Extended data:

Data type keyword

Short: decorated int, short integer data, decorated int can be omitted.

Long: decorated int, long integer data, decorated int can be omitted.

Long long: decorated int, which is a long integer data, and can be omitted.

Signed: modifies integer data and has a signed data type.

Unsigned: decorated integer data, unsigned data type.

Restrict: Used to define and constrain pointers and indicate that pointers are the initial and only way to access data objects.