Monday, June 18, 2012

Homework 4: Constants

1. Declare an  int constant,  MonthsInYear , whose value is  12 .

const int MonthsInYear = 12 ;

2.  Declare an  int constant  MonthsInDecade whose value is the value of the constant  MonthsInYear (already declared) multiplied by  10 .


const int MonthsInDecade = MonthsInYear * 10 ;

No comments:

Post a Comment