C Programming Code Examples C > Code Snippets Code Examples Use fprintf and fscanf to save and read file Use function as for loop control variable Use fwrite and fread to save and read Use getchar() in for loop Use getchar() to read user choices Use getche() to receive user selection Use gets to get the whole string Use global variable in function Use if else Use int as if condition Use int as the while loop controller Use integer as the for loop controller Use macro to find the minor variable Use malloc to allocate memory Use printf to control the output format Use register int in function Use ternary operator in printf Use the command line parameter Use the mod % operator Use the system quick sort Use two if statements using default number of digits using normal array subscripting using sizeof and pointer arithmetic using the strcpy function Variable scope: in and out a block Variable scope:inside a function Variations on a single integer verifying array initialization Viewing the contents of a file While loop to print char While to sum integers wint_t towlower vs tolower Work with int and float Work with random number Write out file writes a character to the output stream writes a character to the stream writes count number of objects writes the string to the standard output device Writing a file a character at a time Writing strings to a file Page 1 Page 14 Page 15