July 2015
Intermediate to advanced
380 pages
10h 15m
English
You should be getting a grasp of how a simple C program is structured, so let’s do the next simplest thing and make some variables of different types:
ex7.c
1 #include <stdio.h> 2 3 int main(intargc, char*argv[]) 4 { 5 int distance = 100; 6 float power = 2.345f; 7 double super_power = 56789.4532; 8 char initial = 'A'; 9 char first_name[] = "Zed"; 10 char last_name[] = "Shaw"; 11 12 printf("You are %d miles away.\n", distance); 13 printf("You have %f levels of power.\n", power); 14 printf("You have %f awesome super powers.\n", super_power); 15 printf("I have an initial %c.\n", initial); 16 printf("I have ...
Read now
Unlock full access