Thursday, December 9, 2010

use of a constant

//This program demonstrates the use of a constant

#include

int main()
{
const int constantNumber = 100; //Declaration of a constant.

It must be initialized immediately, else it picks up a garbage value.

//constantNumber = 30; Will generate an error. Cannot change the value of a constant

printf("The value is %d", constantNumber);
return 0;
}



Download RealPlayer for FREE

No comments:

Post a Comment