You can initialize variables, as in the following program:
#includemain ( ) { int size_one = 600; int size_two = 100; int 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
Note that the print specification for integers is
%i
, rather than
%f
, which is appropriate only for floating-point numbers.