From 67d44d78dd447daa25f32807d5814d8fb57ce5d5 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 5 Sep 2011 09:10:19 -0400 Subject: [PATCH] doing 7.3 extra credit --- ex6.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ex6.c b/ex6.c index 4f4bca7..118d615 100644 --- a/ex6.c +++ b/ex6.c @@ -2,16 +2,16 @@ int main(int argc, char *argv[]) { - int distance = 100; - float power = 2.345f; + int distance = 0xaf + 0747; + float power = 2.345f + 'Z' + 'A' + 'P'; double super_power = 56789.4532f; char initial = 'A'; char first_name[] = "Zed"; - char last_name[] = "Shaw"; + char last_name[] = {'S', 'h', 'a', 'w', '\0'}; - printf("You are %d miles away.\n", distance); - printf("You have %f levels of power.\n", power); - printf("You have %f awesome super powers.\n", super_power); + printf("You are %08d miles away.\n", distance); + printf("You have %.2f levels of power.\n", power); + printf("You have %.3f awesome super powers.\n", super_power); printf("I have an initial %c.\n", initial); printf("I have a first name %s.\n", first_name); printf("I have a last name %s.\n", last_name);