about summary refs log tree commit diff stats
path: root/1.2.c
blob: 9614161533dd78db64f8b3d2b4ebd379816c39fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <stdlib.h>

#define LOWER 0
#define UPPER 300
#define STEP  20

int main() {
    float fahr;
    size_t fahrs;
    void *fahrp;
    fahrs = sizeof(float);
    fahrp = malloc(fahrs);
    fahr = 0;
    printf("value:%f size:%d pointer: %p\n", fahr, fahrs, fahrp);

    printf("%3s\t%6s\n", "F", "C");
    for (fahr=UPPER; fahr >= LOWER; fahr -= STEP) {
        printf("%3.0f\t%6.2f\n", fahr, 5. * (fahr - 32.) / 9.);
    }
    free(fahrp);
    return 0;
}