Introduction

1.4 - Curly braces


The curly braces {} are used to group statements together. In the main function, the curly braces contain these lines:

std::cout << "Time flies like an arrow." << std::endl;
std::cout << "Fruit flies like a banana." << std::endl;

This allow these lines to be run, unlike the last line which is outside the main function curly braces.

Task

Make the program also prints out - Groucho Marx after the other lines.

  • Move the line std::cout << "- Groucho Marx" << std::endl; inside the main function curly braces after the last line in it.
#include <iostream> int main() { std::cout << "Time flies like an arrow." << std::endl; std::cout << "Fruit flies like a banana." << std::endl; } std::cout << "- Groucho Marx" << std::endl;