by Dinesh Thakur

 

#include<iostream.h>

#include<conio.h>
void main()
   {
        int code;
        clrscr();
        cout<<"Enter the color code : ";
        cin>>code;
        if(code==1 )
             {
                     cout<<"Color is Red";
              }
        else if(code==2)
             {
                     cout<<" Color is Green";
             }
       else if(code==3)
            {
                     cout<<" Color is White";
             }
      else if(code==4)
             {
                    cout<<"Color is Yellow";
              }
      else
             {
                   cout<<" No Color code defined";
              }
                   cout<<endl;
                   cout<<"End of the Program ";
                   getch();
}

Ladder If Statement