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:
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:
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?