# Tag Archives: Program

## What is a Program? – Here’s Everything You Need to Know

A computer program, or simply a program, is a sequence of instructions that instructs the system to perform a particular task. For example, we use Google Maps to find a specific location and directions to that location. This application is instructed to do so via a program. If you want to explore more about a program or a… Read More »

## Program to Rotate an Array

You are given an array. Rotate the array clockwise. Examples:  Input:  arr[] = {1, 7, 3, 4, 5} Output: arr[] = {5, 1, 7, 3, 4}j Approach 1: Cyclic Method In this approach, we will rotate the array in-place i.e., we will be rotating the array without using any extra space.  Algorithm Iterate over the input array and… Read More »

## Write a Program to Print the Following Pattern

Problem Statement We need to write a script in C, C++, and Python that can print the following pattern of Alphabets based on the user’s entered letter. Input  letter = F Output A AB ABC ABCD ABCDE ABCDEF Algorithm Ask the user to enter the height of the pattern h which ranges between 1 to 26 (A to… Read More »

## Write a Program to Print the Following Triangle

Problem Statement 1 We need to write a program in C, C++, and Python that can print the following triangle pattern, based on the user entered height. Let say the height of the triangle is 8 Input: height =8 Output * ** *** **** ***** ****** ******* ******** Algorithm The algorithm of this problem is pretty straightforward. Ask… Read More »

## Write a Program to Count no. of alphabets, digits and spaces present in a file

In this Programming tutorial, we will learn how to write a script in C++ and Python that can count the number of alphabets, digits, and spaces present in a text file. To write such a script we should know how to perform file handling in C++ and Python. With the help of file handling, we can read the… Read More »

## Write a Program to Print Square Using * Character

Printing patterns using * is one of the most common interview questions. In this article, we will learn how to print a hollow square bracket in a console using C, C++, and Python programming languages. The Syntax for all these three programming languages is different but the algorithm and logic would remain the same to print the square… Read More »

## Write a Program to Print Triangle Using * Character

In this article, we will learn how to print inverted right-angle triangles in C, C++, and Python. In the program, we will ask the user to enter the height of the triangle and print the triangle with entered height. Algorithm Ask the user to enter the height (h) of the triangle. Create a loop i from 0 to… Read More »

## How to determine Java version from Program

Introduction Java has many versions so far, and with each version, some significant features are released. There are several differences between the APIs and how the code is written from version to version. That’s why to use some of the functionalities, we need to know which version our codebase is. For example, unboxing/boxing was introduced only in Java5,… Read More »

## Java Program Internal

Program Internal Once we write a Java program in the source code. The Java compiler converts the source code in the byte code that is platform-independent and can be run on any platform. We will discuss the working of compiling and running the Java program. What happens at compile-time? Java has a java compiler that converts the source… Read More »

## A Simple Python Program to Shuffle a Deck of Cards

Here in this article, we have provided a Python program that can shuffle a deck of cards. It is a simple Python program that generates 5 random cards. Prerequisite Topics In order to successfully implement and understand the Python program, you need to have a good understanding of the following concepts in Python: Python for Loop Modules in… Read More »