Home Segments Index Top Previous Next

46: Mainline

You can combine several initializations into one, more concise variable declaration, as in the following example:

#include  
main ( ) { 
  int size_one = 600, size_two = 100, size_three = 200; 
  printf ("The average number of shares traded is "); 
  printf ("%i", (size_one + size_two + size_three) / 3); 
  printf ("\n"); 
} 
--- Result --- 
The average number of shares traded is 300