Question: Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print Distant future (without quotes). Else, if given Year is 2001
Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Else, if given Year 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 'endi' outputs a newline. 494090 2694856 qizy? 1 #include 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 12} int givenYear; cin >> givenYear; * Your solution goes here */ return 0;
Step by Step Solution
3.45 Rating (152 Votes )
There are 3 Steps involved in it
The modified code with the ifelse statemen... View full answer
Get step-by-step solutions from verified subject matter experts
