Explore BrainMass

Constant and Variable in a Program



© BrainMass Inc. brainmass.com August 19, 2018, 3:16 am ad1c9bdddf

Solution Preview

1. A C language programmer has to tell the system before-hand, the type of numbers or characters he is using in his program. These are data types. In C language, data types can be broadly classified as Primary data type, Derived data type and User-defined data type. Primary data type are fundamental data types, contains int, char, float, and double. int is used to define integer numbers. char defines characters. float is used to define floating point numbers. Double is used to define BIG floating point numbers and it reserves twice the storage for the number.
Derived data types defined by the system include pointer and array. User defined data types are built on existing types. These include typedef and enumerations.


Solution Summary

This solution discusses data types in C and the differences between constants and variables in a program.