Hi
If I include the call function system("color 1a") changes the console's background color and text color. But I was the bold part to appear in different color, let's say, green? How do I change the color of some particular line or part in the program? I'm using Windows XP so you can tell me something Windows specific; it will do the job. Thanks your help and time. And please don't forget I'm a newbie to programming.
Code:// program to calculate area of a circle #include <iostream> #include <cmath> #include <cstdlib> #include <windows.h> #include <stdlib.h> using namespace std; int main() { system("color 1a") float R, A, C; cout << "Enter the radius R = "; cin >> R; A = 3.142*R*R; C = 2*3.142*R; if (R >= 0) { cout << "Area = " << A << endl; cout << "Circumference = " << C << endl; } else cout << "Invalid R" << endl; system ("PAUSE"); }



1Likes
LinkBack URL
About LinkBacks





>