Computer Science, asked by Masterdevil8360, 1 year ago

How to write the first C++ program?

Answers

Answered by AmardeepS
0

First C++ program

1. Writing your program in a text-editor and saving it with correct extension (.CPP, .C, .CP)

2. Compiling your program using a compiler or online IDE

Let us now look at the program in C++:

// Simple C++ program to display "Hello World"  

// Header file for input output functions  

#include<iostream>  

using namespace std;  

// main function -  

// where the execution of program begins  

int main()  

{  

   // prints hello world  

   cout<<"Hello World";    

   return 0;  

}  

Output:  

Hello World

Similar questions