| @ -0,0 +1,17 @@ | |||||
| #include <stdio.h> | |||||
| #define CM_PER_INCH 2.54 | |||||
| int main (void) { | |||||
| float inches; | |||||
| printf("Enter your height in inches: "); | |||||
| scanf("%f", &inches); | |||||
| printf("Your height in cm is %.2f\n", inches * CM_PER_INCH); | |||||
| return 0; | |||||
| } | |||||
| @ -0,0 +1,24 @@ | |||||
| #include <stdio.h> | |||||
| int main (void) { | |||||
| float cups; | |||||
| printf("Give a volume in cups: "); | |||||
| scanf("%f", &cups); | |||||
| float pints = cups / 2; | |||||
| float ounces = cups * 8; | |||||
| float tablespoons = ounces * 2; | |||||
| float teaspoons = tablespoons * 3; | |||||
| printf("The given volume are %0.2f pints\n", pints); | |||||
| printf("The given volume are %0.2f ounces\n", ounces); | |||||
| printf("The given volume are %0.2f tablespoons\n", tablespoons); | |||||
| printf("The given volume are %0.2f teaspoons\n", teaspoons); | |||||
| return 0; | |||||
| } | |||||
| @ -0,0 +1,14 @@ | |||||
| SRC := $(shell ls *.c) | |||||
| .PHONY: all | |||||
| all: | |||||
| %: %.c | |||||
| gcc -Wall -Wextra $@.c -o $@ | |||||
| .PHONY: clean | |||||
| clean: | |||||
| @rm -f ?? | |||||