lesson 5 showvars c
[[lesson_5_showvars_c]] last edit on Aug 8, 2005 4:37 AM by rescued_by_c

[user02@FC4 Lesson05]$ cat -n showvars.c
   1  #include <stdio.h>
   2
   3  int main(void)
   4  {
   5     int age = 32;
   6     float salary = 25000.75;
   7     long distance_to_the_moon = 238857;
   8
   9     printf("The employee is %d years old\n", age);
  10     printf("The employee makes $%f\n", salary);
  11     printf("The moon is %ld miles from the earth\n", distance_to_the_moon);
  12
  13     return 0;
  14  }
[user02@FC4 Lesson05]$ gcc -o showvars showvars.c
[user02@FC4 Lesson05]$ ./showvars
The employee is 32 years old
The employee makes $25000.750000
The moon is 238857 miles from the earth