#include <iostream>
int main()
{
float a, b, c, d, Mean;
std::cout << "Enter first number: ";
std::cin >> a;
std::cout << "Enter second number: ";
std::cin >> b;
std::cout << "Enter third number: ";
std::cin >> c;
std::cout << "Enter fourth number: ";
std::cin >> d;
std::cout << "The mean is: " << (a + b + c + d) / 4;
}
1: As you see above every "std::cout" is followed "std::cin", is this possible in some situation where "std::cout" or "std:cin" is followed another "std::cout" or "std::cin" respectively?
2: I want the line "The mean is:" to appear red and bold? How do I do this?
3: I have seen my friend use commands "\endl" and "\n" (hope I have them right). What functions do they serve?
It is very kind of you to help me. I'm much obliged.