Question: C++ CHALLENGE ACTIVITY 3.6.2: Multi-branch if-else statement: Print century. Write an if-else statement with multiple branches. If given Year is 2101 or greater, print Distant
C++

CHALLENGE ACTIVITY 3.6.2: Multi-branch if-else statement: Print century. Write an if-else statement with multiple branches. If given Year is 2101 or greater, print "Distant future" (without quotes). Else, if givenYear is 2001 or greater (2001-2100), print "21st century". Else, if given Year is 1901 or greater (1901-2000), print "20th century". Else (1900 or earlier), print "Long ago". End with a newline. Remember that outputting 'endl' outputs a newline. 1 test passed All tests passed 290064.2003046.qx3zqy7 4 int main() { 5 int givenYear; 6 7 cin >> givenYear; 8 if(givenYear>=2101) 9 { 10 cout=2001){ 13 cout=1901) 16 { 17 cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
