Showing posts with label colour. Show all posts
Showing posts with label colour. Show all posts

Wednesday, 27 December 2017

IMPLEMENT BINARY SEARCH IN AN ARRAY

In this blog let us see how to do a Bubble sort in a given array-

C++ code to implement binary sort in an array-

Sample output for the above program-


For any c++ code ask me in the comments below.
I will code and give you the answer, thus making your homework easy.



Monday, 25 December 2017

HOW TO CHANGE COLOR OF TEXT IN C++

In this blog let us see how to change color of text in C++

C++ code to change color of the text-



Sample output for the above program-


Color codes for different color-

  • BLACK 0
  • BLUE 1
  • GREEN 2
  • CYAN 3
  • RED 4
  • MAGENTA 5
  • BROWN 6
  • LIGHTGREY 7
  • DARKGREY 8
  • LIGHTBLUE 9
  • LIGHTGREEN 10
  • LIGHTCYAN 11
  • LIGHTRED 12
  • LIGHTMAGENTA 13
  • YELLOW 14
  • WHITE 15
  • BLINK 128

Note-

With reference to my c++ code above, anything written below line number 8 will be printed in Light magenta.
In order to change color once again in the program, write "SetConsoleTextAttribute(handle,(any number from above of your choice));".
This will change the color of all the text below it.


For any c++ code ask me in the comments below.
I will code and give you the answer, thus making your homework easy.