Use of '#if' with '#elif'


    #include <iostream.h>
    #include <conio.h>
    #define m 2
    void main()
    {
        clrscr () ;
        #if m == 1
            cout << " 'm' is One" ;
        #elif m == 2
            cout << " 'm' is Two" ;
        #elif m == 3 || m == 4 || m == 5
            cout << " 'm' is Between Three and Five"  ;
        #elif m >= 6 && m <= 10
            cout << " 'm' is between Six and Ten" ;
        #else
            cout << " 'm' is not in the range [1-10]" ;
        #endif
        getch () ;

    }

0 comments:

Post a Comment

 
 
 
 


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