c++ contains

Include Header File
The first step is to include the necessary header file using the #include directive.

Using Namespace
By using the using namespace directive, you can avoid having to qualify the names of the standard library methods and types with std::.

Main Function
The main function is the entry point of the program, where the program's execution begins.

Variable Declaration
In this step, you declare any variables that will be used in the program.

User Input
You can use input/output stream objects like std::cin to get input from the user.

Perform Operations
Perform any calculations or operations using the variables and user input.

Display Output
Use the std::cout object to display the output to the user.

#include <iostream>

using namespace std;

int main() {
    // Variable declaration
    int num1, num2, sum;

    // User input
    cout << "Enter first number: ";
    cin >> num1;
    cout << "Enter second number: ";
    cin >> num2;

    // Perform operations
    sum = num1 + num2;

    // Display output
    cout << "Sum is: " << sum;

    return 0;
}