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
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>

int main(int argc, char *argv[]) {
    
    int n = 65;  // assigning a constant to variable
    printf("65  with %%d:  %d\n", n);
    printf("65  with %%c:  %c\n", n);
    printf("65  with %%x:  %x\n", n);
    printf("\n");

    int m = 'A';
    printf("65  with %%d:  %d\n", m);
    printf("65  with %%c:  %c\n", m);
    printf("65  with %%x:  %x\n", m);
    printf("\n");

    int o = '*' + '/';
    printf("'*' + '/'  with %%d:  %d\n", o);
    printf("'*' + '/'  with %%c:  %c\n", o);
    printf("'*' + '/'  with %%x:  %x\n", o);
    printf("\n");

    return 0;
}

This content is protected and may not be shared, uploaded, or distributed.    © 2019 Alexander J. Quinn.