Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.4K+ articles
C++
3.8K+ articles
C++ Programs
1.5K+ articles
STL
1.3K+ articles
CPP Examples
714+ articles
Computer Science Fundamentals
431+ articles
cpp-string
157+ articles
C/C++ Puzzles
69+ articles
C++ String Programs
5+ articles
C++ Basic Programs
24 posts
Recent Articles
Popular Articles
Patterns in C++
Last Updated: 11 February 2026
Patterns are an important concept in programming and an excellent way to understand loops in C++. By using nested loops, we can generate different patterns with stars, num...
read more
C++
C++ Basic Programs
Multiply Function that works for All Numeric Types in C++
Last Updated: 16 June 2025
In C++, function overloading allows us to create multiple functions with the same name but different parameter types. Using this concept, we can multiply functions to perf...
read more
C++
C++ Basic Programs
How to Access Elements of a Pair in C++?
Last Updated: 23 July 2025
In C++, a pair container is defined inutilityheader that can store two values that may be of different data types so as to store two heterogeneous objects as a single unit...
read more
C++ Programs
C++
Picked
STL
cpp-pair
C++ Basic Programs
C++ Program To Find Power Without Using Multiplication(*) And Division(/) Operators
Last Updated: 17 January 2023
Method 1 (Using Nested Loops):We can calculate power by using repeated addition. For example to calculate 5^6. 1) First 5 times add 5, we get 25. (5^2) 2) Then 5 times add...
read more
C++
C++ Basic Programs
Reverse a Number in C++
Last Updated: 23 July 2025
In this article, we will learn to write a C++ program to reverse a number. Reversing the digits of a number means changing the order of the digits of the number so that th...
read more
C++ Programs
C++
C++ Basic Programs
C++ Program For Fibonacci Numbers
Last Updated: 27 May 2026
The Fibonacci series is a sequence in which each number is the sum of the previous two numbers. The series starts with 0 and 1, and the remaining terms are generated using...
read more
C++ Programs
C++
Fibonacci
C++ Basic Programs
C++ Program To Find All Factors of A Natural Number
Last Updated: 23 July 2025
Given a natural number n, print all distinct divisors of it.Examples: Input : n = 10 Output: 1 2 5 10 Input: n = 100 Output: 1 2 4 5 10 20 25 50 100 Input: n = 12...
read more
C++
C++ Basic Programs
C++ Program To Find Sum of First N Natural Numbers
Last Updated: 16 January 2026
Natural numbers are those positive whole numbers starting from 1 (1, 2, 3, 4, ...). In this article, we will learn to write a C++ program to calculate the sum of the first...
read more
C++ Programs
C++
C++ Basic Programs
C++ Program To Find Armstrong Numbers Between Two Integers
Last Updated: 23 July 2025
A positive integer with digits a, b, c, d... is called an Armstrong number of order n if following condition is satisfied. abcd... = an + bn + cn + dn +...153 = 1*1*1 + 5*...
read more
C++ Programs
C++
C++ Basic Programs
GCD of Two Numbers in C++
Last Updated: 25 May 2026
The Greatest Common Divisor (GCD) of two numbers is the largest number that divides both numbers exactly without leaving a remainder. It is widely used in mathematics, cry...
read more
C++ Programs
C++
C++ Basic Programs
CPP Examples
C++ Program For Sum of Natural Numbers Using Recursion
Last Updated: 23 June 2023
Natural numbers include all positive integers from 1 to infinity. It does not include zero (0). Given a number n, find the sum of the first n natural numbers. To calculate...
read more
C++ Programs
C++
C++ Basic Programs
C++ Program To Check If a Prime Number Can Be Expressed as Sum of Two Prime Numbers
Last Updated: 17 January 2023
Given a prime number N . The task is to check if it is possible to express N as sum of two separate prime numbers.Note: The range of N is less than 108.Examples: Input: ...
read more
C++ Programs
C++
C++ Basic Programs
C++ Program to Find Factorial of a Large Number Using Recursion
Last Updated: 23 July 2025
Given a large number N, task is to find the factorial of N using recursion.Factorial of a non-negative integer is the multiplication of all integers smaller than or equal ...
read more
C++ Programs
C++
C++ Basic Programs
C++ Program To Find The Roots Of Quadratic Equation
Last Updated: 20 March 2024
Given a quadratic equation in the form ax2 + bx + c, find roots of it. Examples:Input : a = 1, b = -2, c = 1Output: Roots are real and same 1Input : a = 1,...
read more
C++ Programs
C++
C++ Basic Programs
C++ Program To Check Whether a Number is Prime or not
Last Updated: 23 July 2025
Given a positive integer N. The task is to write a C++ program to check if the number is prime or not. Definition: A prime number is a natural number greater than 1 that h...
read more
C++ Programs
C++
C++ Basic Programs
1
2