Problem Statement
We need to write a program in C, C++, and Python that creates a loading bar on the console window. All these three programming languages support third-party packages or libraries to print a loading progress bar, but we will use the basic coding to implement one of our own.
Algorithm
The idea behind creating a process and loading bar is quite straightforward. We will create a loop that will print a specific character (ASCII code 219) again and again, but we will put a time delay between printing the character so that it could give a loading or processing effect.
C Program to create a loading Bar
Output
C++ Program to create a loading Bar
Output
Python Program to create a loading Bar
Output
Wrapping Up!
In the above program, we just print the character of ASCII code 219 (C, C++) and 9680(python) as process blocks for the loading bar. To give it the effect of the loading bar, we have put a time delay between two print statements. In your upcoming programming interviews, you may be asked to print a loading bar with the programming language you are comfortable with, so learn the logic and try the above programs for yourself.
People are also reading:
- Python Program to Find the Sum of Natural Numbers
- Python Program to Find Armstrong Number in an Interval
- Python Program to Check Armstrong Number
- Python Program to Display the Multiplication Table
- Python Program to Print all Prime Numbers in an Interval
- Python Program to find Hash of File
- Python Program to Find the Size of Image
Leave a Comment on this Post