A snapshot of the execution of the above program:

In the above output the total age of the students is 123 and the actual average should be 12.3 but as we are using integer data types so the decimal part is truncated and the whole number 12 is assigned to the variable AverageAge.

 

 

 

 

Previous

 

 

TOC

 

 

Next