Fayzan Motiwala
last year
Fayzancountry asked

Write a statement that prints the result of the mathematical expression (5 * (9 + 13) / 2) * 7 on the screen and terminate the message with a new line.

Kelish Rai
Expert
last year
Kelish Rai answered

Here's how you can print the result of (5 * (9 + 13) / 2) * 7 on the screen in C++, with the output ending on a new line:

#include <iostream>
using namespace std;

int main() {
    cout << (5 * (9 + 13) / 2) * 7 << endl;
    return 0;
}

If this isn't what you were looking for, let me know—I'm happy to help.

Also, if you're just getting started, I’d recommend going through the course step by step. That way, you'll build a strong foundation in C++ and understand concepts more easily.

Just a quick note: We focus on answering questions related to the page or course.

C++
This question was asked as part of the Learn C++ Basics course.