Posts

C++ Tutorial practice

Image
 C++ programs and output:- Program 1 - Numerology This C++ program prompts for birth date and outputs planet for that date. In the above screen shot, user has entered number 23, that is, birth date is 23, which belongs to Planet Mercury In the above screen shot, user has entered ooo, which is not a number, so it says 0 No numerology or planet for you... #include <iostream> using namespace std; //Numerology int main(){ int a; int b; cout << "Enter your Birth date: "; cin >> a; cout << "Your Birth date: " << a << "\n"; if (a == 1 || a == 10 || a == 19 || a == 28) { cout << "You have born on: " << a << " Your planet is SUN " << "\n"; } else if (a == 2 || a == 11 || a == 20 || a == 29) { cout << "You have born on: " << a << " Your planet is MOON " << "\n"; } else if...