From 997b3784c74dcac3913bc1a38cd65cfa4abfd155 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 5 Sep 2011 08:14:12 -0400 Subject: [PATCH] working version of ex6.c --- .gitignore | 1 + ex6.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ex6.c diff --git a/.gitignore b/.gitignore index aaabdc6..530a0f4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ ex1 ex3 ex4 ex5 +ex6 diff --git a/ex6.c b/ex6.c new file mode 100644 index 0000000..4f4bca7 --- /dev/null +++ b/ex6.c @@ -0,0 +1,22 @@ +#include + +int main(int argc, char *argv[]) +{ + int distance = 100; + float power = 2.345f; + double super_power = 56789.4532f; + char initial = 'A'; + char first_name[] = "Zed"; + char last_name[] = "Shaw"; + + 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("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); + printf("My whole name is %s %c. %s.\n", + first_name, initial, last_name); + + return 0; +}