Tapas Kumar Ghosh

Tapas Kumar Ghosh

185 Articles Published

Articles by Tapas Kumar Ghosh

Page 3 of 19

How will you print numbers from 1 to 100 without using loop in C?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 15-Mar-2026 4K+ Views

You can print numbers from 1 to 100 without using traditional loops by employing alternative control structures like recursive functions and goto statements. These methods achieve the same repetitive behavior through different mechanisms. Method 1: Using Recursion Recursion allows a function to call itself repeatedly until a base condition is met. We can use this property to print numbers sequentially without explicit loops − #include void printNumbers(int n) { if (n > 100) return; printf("%d ", n); ...

Read More

What is the size of void pointer in C/C++ ?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 15-Mar-2026 9K+ Views

The size of void pointer varies from system to system. If the system is 16-bit, size of void pointer is 2 bytes. If the system is 32-bit, size of void pointer is 4 bytes. If the system is 64-bit, size of void pointer is 8 bytes. This is because a pointer stores memory addresses, and the size depends on the system's addressing capability. Syntax To find the size of a void pointer, use the sizeof() operator: sizeof(void*) sizeof(pointer_variable) Example: Finding Size of Void Pointer The following example demonstrates how to find the size ...

Read More

Errors in C/C++

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 28-Jul-2025 13K+ Views

In C/C++, an error occurs due to an invalid operation performed by the user. The error normally stops the program execution until it is fixed. So, the error should be removed before compilation and execution. Types of Error in C/C++ Following is the list of errors occur in C/C++ programming: Syntax Error Run-Time Error Linker Error Logical Error Semantic Error In this article, we will see the implementation of error in C/C++ programs. Syntax Error The syntax error ...

Read More

All pair combinations of 2 tuples in Python

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 11-Jul-2025 401 Views

Python tuples are immutable sequences that used to store collections of items. When working with two tuples, you may sometimes need to generate all possible pairs, where each pair contains one element from the first tuple and one from the second. In this article, we will learn different ways to generate all pair combinations from two tuples Following are input-output scenarios for pairing combinations of two tuples: Input: first_tuple = (1, 3) second_tuple = (7, 9) Output: [(1, 7), (1, 9), (3, 7), (3, 9), (7, 1), (7, 3), (9, 1), (9, 3)] Explanation: At index 0 of first_tuple pairs ...

Read More

Aligning table to X-axis using matplotlib Python

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 11-Jul-2025 2K+ Views

The Python Matplotlib library allows us to create visual plots from given data. To make the data easier to read and relate to the chart, we can display it in the form of a table and position it directly below the corresponding bar chart. Since the x-axis runs horizontally, we arrange the table in the same direction so that each value aligns correctly under its corresponding bar. Based on this concept, we demonstrate the diagram as follows: Steps to Align a Table to the X-axis Using Matplotlib Following are the steps to create a table and store data ...

Read More

Age Calculator using Python Tkinter

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 11-Jul-2025 2K+ Views

An age calculator in Python using Tkinter is a GUI (Graphical User Interface) application that allows users to determine their age based on their date of birth (DOB). To design the user interface of this application, we use various methods provided by the Tkinter library such as Tk(), pack(), Entry(), Button(), and more. GUI of Age Calculator Let us build a GUI-based age calculator where the user can enter their age in the format of years, months, and days. Ensure that single-digit numbers are prefixed with a 0. Creating an Age Calculator Application using Python Tkinter To create an ...

Read More

All possible concatenations in String List Using Python

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 11-Jul-2025 2K+ Views

All possible concatenations in a string list means to generate every possible combination of strings by concatenating two or more elements from a given list of strings. In this article, we are given a string list and we need to find all its possible concatenations. Following are the input-output scenarios for concatenating string's list: Scenario 1 Input: X = ['TP', 'Tutorix'] Output: ['TP', 'Tutorix', 'TPTutorix', 'TutorixTP'] Explanation: When the list contains two strings, say 'TP' and 'Tutorix', it returns two more additional possibilities like 'TPTutorix' and 'TutorixTP'. Scenario 2 Input: X = ['AP', 'BQ', 'CR'] Output: ['AP', 'BQ', 'CR', ...

Read More

C++ Program to Implement Sparse Array

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 01-Jul-2025 3K+ Views

What is Sparse Array?Sparse array is used to determines the dimension of an array in which most of the elements are zero. It can be used for matrix calculation. Characteristics of Sparse Array Following are list of points that defines the characteristics of a sparse array: Most of the elements are zero or null values which means it is unused. Only non-zero elements and their indexes are stored. It is used to save the memory while comparing to normal array calculation. Example The Sparse array of ...

Read More

What are the rules for calling the superclass constructor C++?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 01-Jul-2025 12K+ Views

In C++, a superclass serves as a base/parent class. When we create a derived class (or child class) from a superclass, sometimes we have to call the constructor of the base class along with the constructor of the derived class. Unlike Java, there is no reference variable for the superclass. If the constructor is non-parameterized, then it will be called automatically with the derived class, otherwise, we have to put the superclass constructor in the initializer list of the derived class. Constructor Without Arguments It is a default constructor where no argument is passed to it. Here, we create a ...

Read More

What do you mean by a dynamic initialization of variables?

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 01-Jul-2025 9K+ Views

Dynamic initialization of object refers to initializing the objects at run time i.e., the initial value of an object is to be provided during runtime. Dynamic initialization can be achieved using constructors and passing parameters values to the constructors. This type of initialization is required to initialize the class variables during runtime. Why do we need the dynamic initialization? Dynamic initialization of objects is useful because It utilizes memory efficiently. Various initialization formats can be provided using overloaded constructors. It has the flexibility of using different formats ...

Read More
Showing 21–30 of 185 articles
« Prev 1 2 3 4 5 19 Next »
Advertisements