July 2015
Intermediate to advanced
380 pages
10h 15m
English
Keep that Makefile around since it’ll help you spot errors, and we’ll be adding to it when we need to automate more things.
Many programming languages use the C way of formatting output, so let’s try it:
ex3.c
1 #include <stdio.h> 2 3 int main() 4 { 5 int age = 10; 6 int height = 72; 7 8 printf("I am %d years old.\n", age); 9 printf("I am %d inches tall.\n", height); 10 11 return 0; 12 }
Once you’ve finished that, do the usual make ex3 to build and run it. Make sure you fix all warnings.
This exercise has a whole lot going on in a small amount of code, so let’s break it down:
• First we’re including another header file called stdio.h
Read now
Unlock full access