Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

C++ Exercises: Print a welcome text in a separate line

C++ Basic: Exercise-1 with Solution

Write a program in C++ to print a welcome text in a separate line.

Pictorial Presentation:

C++ Exercises: Print a welcome text in a separate line

Sample Solution:

C++ Code :

#include <iostream>
using namespace std;
 
int main()
{
    cout << "\n\n Print a welcome text in a separate line :\n";
	cout << "----------------------------------------------\n";
    cout << " Welcome to \n" ;
    cout << " w3resource.com "<<endl ;
    
}

Sample Output:

 Print a welcome text in a separate line :                             
----------------------------------------------                         
 Welcome to                                                            
 w3resource.com

Flowchart:

Flowchart: Print a welcome text in a separate line

C++ Code Editor:

Contribute your code and comments through Disqus.

Previous: C++ Basic Exercises Home
Next: Write a program in C++ to print the sum of two numbers.

What is the difficulty level of this exercise?