Use of '#define' for constant definition


    #include <iostream.h>
    #include <conio.h>
    #define size 5                /* constant definition */
    void main()
    {
        int a[size] ;               /* use of synonym 'size' */
        int i ;
        clrscr () ;
        for ( i = 0; i < size; i++ )    /* use of synonym 'size' */
            a[i] = i ;
        cout<<  "The array elements are :\n" ;
        for ( i = 0; i < size; i++ )  /* use of synonym 'size' */
            cout << a[i] ) ;
        getch () ;
    }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|