hello2.c (#3)

  #include <stdio.h>

  int main()
  {
     int age;

     age = 23;
     printf("Hello world!\n");
     printf("My age is %d.\n", age);
     return 0;
  }
  • Here, we want to print the variable age. Notice the %d sign. This sign signifies where we'd like to place the output of age variable.
  • What's the output?
    Hello world!
    My age is 23.
    |
  • Let's examine another example.

 


Where to go

Chapter 2
News Page
Lesson 1 contents
Contacting Me


Roby Joehanes © 2001

Hosted by www.Geocities.ws

1