1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
int main(int argc, char* argv[]) {
int n = 65;
printf("n == %d\n", n);
n = 0x41; // sixty-five expressed in base 16
// (hexadecimal). (16 x 4) + (1 x 1) = 65
printf("n == %d\n", n);
n = 0101; // sixty-five expressed in base 8 (octal).
// (64 x 1) + (8 x 0) + (1 x 1) = 65
printf("n == %d\n", n);
n = 'A'; // character constant with ASCII value 65
printf("n == %d\n", n);
printf("\n");
printf("n * 2 == %d\n", n * 2);
printf("'A' * 2 == %d\n", 'A' * 2);
printf("'A' + 'C' == %d\n", 'A' + 'C');
return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */
|
© Copyright 2022 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.