Tapas Kumar Ghosh has Published 226 Articles

What is the proper declaration of main in C++?

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:39:38

142 Views

The main() function is the entry point of every C++ program where execution begins. It is invoked automatically when the program is executed. The main() function returns the execution status to the operating system (indicating whether the program executed successfully or not). You can also use optional command-line arguments, argc ... Read More

How to call a parent class function from derived class function in C++?

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:31:11

11K+ Views

In the OOPs concept of C++, the parent class represents the root of the hierarchy while the derived class is inherited from the parent class. The derived class is presented using the scope resolution operator (::). The derived class is also known as the child class or subclass. What is ... Read More

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

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:12:19

4K+ Views

You can print the numbers from 1 to 100 without a loop by using the various methods like recursive function and goto statement that print the list of integers.The following are the approaches to print the numbers from 1 to 100: Using Recursion As we know, recursion is the process ... Read More

C++ Program to Find Factorial of Large Numbers

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:09:05

2K+ Views

A factorial of a number defines the non-negative integer say n that calculate the product of a number by every positive integer until it reaches 1. The symbol of factorial is (!). Mathematically, it is represented by: n! = n x (n-1) x (n-2) x ... x 1 ... Read More

How to convert a single char into an int in C++

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:07:05

774 Views

In C++, converting a single character into an integer is possible using various techniques like STL functions say atoi() and stoi(). Also, you can solve this with the help of ASCII value or stringstream function. Converting Single Char into Int Here, we have list down of four approaches that help ... Read More

C++ Program to Find Fibonacci Numbers using Iteration

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:06:34

8K+ Views

The term Fibonacci numbers is used in mathematics, which calculates the sum of two preceding numbers that starts from 0 and 1 and continues till based on the given number say num. Mathemathematically, it is represented by: Fn = Fn-1 + Fn-2 Let us take an example to understand ... Read More

Character arithmetic in C

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:06:05

5K+ Views

In C, character arithmetic is defined by char data type. This is used to implement arithmetic operations like addition and subtraction on characters in C language. It is used to manipulate the strings. When the characters are used with the arithmetic operations, it converts them into integer value automatically i.e. ... Read More

What are Wild Pointers in C/C++?

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:05:33

3K+ Views

In C/C++, a wild pointer is a type of pointer that has not been initialized to a valid memory address. It points to memory that has been deallocated and is called a dangling pointer. The pointer behaves like a wild pointer when it is declared but not initialized. That is ... Read More

Print \"Hello World\" in C/C++ without using header files

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:02:10

1K+ Views

In C/C++, we use the header files for accessing functions such as int, char, string, etc. The printf() function of C is also a built-in function that is declared in the "stdio.h" header file and it is used to print any kind of data on the console. C to Print ... Read More

What is the difference between printf() and cout in C++?

Tapas Kumar Ghosh

Tapas Kumar Ghosh

Updated on 21-Apr-2025 18:01:01

3K+ Views

Both printf() and Cout are used to display the output format in C and C++ respectively. Each function has its syntax and characteristics that are based on user needs and preferences. In this article, we will learn the difference between print () and cout in a detailed manner. What is ... Read More

Previous 1 ... 5 6 7 8 9 ... 23 Next
Advertisements