Printing Hello World! on the screen is probably the first program for most programmers. It is a basic form of code that demonstrates how programming works.
In this article, we will write a program to display a message on the screen. The message we will print will be Hello World! However, you can print something else, like HELLO PROGRAMMING, if you like.
Problem Statement
The program to display a message on the screen is simple. We need to write programs in C, C++ , and Python that print a HELLO WORLD! message on the console window. All we need to do is use the console print statement in all three programming languages.
1. C Program to Display a Message on the Screen
#include <stdio.h>
int main()
{
//print the message
printf("\n\n\n\n\n\n\n\n\t\t ****************** HELLO WORLD! ********************");
return 0;
}
Output
****************** HELLO WORLD! ********************
2. C++ Program to Display a Message on the Screen
#include<iostream.h>
#include< conio.h>
void main()
{
clrscr();
cout<<"\n\n\n\n\n\n\n\n\t\t\
****************** HELLO WORLD! ********************";
getch();
}
Output
****************** HELLO WORLD! ********************
3. Python Program to Display a Message on the Screen
print("'\n\n\n\n\t\t\t********************** HELLO WORLD! ***********************")
Output
********************** HELLO WORLD! ***********************
Conclusion
The above programs are simple. Printing Hello World is a complete beginner-level program that you often encounter while writing your first program with any
programming language
. All we have done in the above program is print a sequence of characters with some escape characters. The
\n
represents the new line, and the
\t
escape character represents the tab (4 white spaces).
People are also reading:
- C Program to Extract a Portion of String
- Python Program to Display Fibonacci Sequence Using Recursion
- C++ & Python Program to sort an Array Using Bubble Sort
- Python Program to Find Factorial of Number Using Recursion
- Program to Find the Sum of Series 1^2+3^2+5^2+…..+(2n-1)^2
- Python Program to Sort Words in Alphabetic Order
- C++ and Python Program to find the root of quadratic equation
- Python Program to Find the Size of Image
- C++ and Python Code to Find The Sum of Elements Above and Below The Main Diagonal of a Matrix
- Python Program to Find the Factorial of a Number
Leave a Comment on this Post