#include <stdio.h> int main() { int x; the printf ( " Enter an integer: \ n- " ); scanf("%d",&x); if(x%2==1) the printf ( " odd " ); the else the printf ( " even number " ); return 0; }
/ * Program features: An integer between 1 requires user input from the keyboard 1-7 If the input is 1 to 5, it prompts the user is working, to work hard; If the input is 6 or 7, it prompts the user is a rest day, relax; Otherwise, the user is prompted not on the legitimate scope */ #include <stdio.h> int main() { int days; the printf ( " Enter an integer: \ n- " ); scanf("%d",&days); // make up at ××× expression, so as to satisfy the function described procedure IF (Days> = . 1 && Days <= . 5 ) // Days between 1. 5 the printf ( " WorkDays, Fighting \ n- " ); the else IF ( Days> = 6 && Days <= . 7 ) // Days or 6. 7 the printf ( " Weekend, Relax ~ \ n- " ); the else the printf ( " Ooops, Not in. 1 ~. 7 \ n- " ); return 0; }
// Function: // enter a single character from the keyboard // if lowercase letters, uppercase after the conversion output // Otherwise, do nothing, as it is output #include <stdio.h> int main () { char CH ; printf ( " Enter a character: \ the n- " ); scanf("%c",&ch); // according to the procedure described functions, the program complement IF (ch> = 97 && ch <= 122 ) // If ch lowercase letters, lowercase complement determining expression ch ch = CH-, 32 ; // make up of the ch small letters converted to uppercase letters expression statement // Description: the statement is an expression in the end of a semicolon; printf ( " % c \ the n- " , CH); return 0; }