Buciners

Mewarnai di C++

Jan 31st, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #include <windows.h>
  4. void main()
  5. {
  6.    char pilihan;
  7.    cout<<"\n Mewarnai di C++ ";
  8.    cout<<"\n Have fun with c++ ";
  9.    cout<<"\n Pilihan Warna yang tersedia : ";
  10.     cout<<"\n 1.Blue ";
  11.    cout<<"\n 2.Green ";
  12.    cout<<"\n 3.Aqua ";
  13.    cout<<"\n 4.Red ";
  14.    cout<<"\n  Masukan Pilihan Warna mu : ";
  15.    cin>>pilihan;
  16.  
  17.    if(pilihan == 'a')
  18.    {
  19.     system("color 1");
  20.       cout<<"Ini warna Blue ";
  21.    }
  22.    else if(pilihan == 'b')
  23.    {
  24.     system("color 2");
  25.       cout<<"Ini warna Green ";
  26.    }
  27.    else if(pilihan == 'c')
  28.    {
  29.     system("color 3");
  30.       cout<<"Ini warna Aqua ";
  31.    }
  32.    else if(pilihan == 'd')
  33.    {
  34.     system("color 4");
  35.       cout<<"Ini warna Red ";
  36.     }
  37.    else
  38.    {
  39.     cout<<"Pilihan tidak tersedia ";
  40.    }
  41.    getch();
  42.  
  43.  
  44.    getch();
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment