Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Practice Problems
  • Python
  • C
  • C++
  • Java
  • Courses
  • Machine Learning
  • DevOps
  • Web Development
  • System Design
  • Aptitude
  • Projects
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
C++
4.1k+ articles
Strings
3.2k+ articles
C++ Programs
2.4k+ articles
School Programming
1.4k+ articles
STL
1.2k+ articles
CPP Examples
700+ articles
cpp-string
140+ articles
C++ String Programs
5 articles

C++ Basic Programs

22 posts
Reverse a Number in C++
Last Updated: 21 September 2023
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 ...read more
image
C++
C++ Programs
C++ Basic Programs
C++ Program For Fibonacci Numbers
Last Updated: 14 October 2024
TheFibonacci seriesis the sequence where each number is the sum of the previous two numbers. The first two numbers of the Fibonacci series a ...read more
Fibonacci
C++
C++ Programs
C++ Basic Programs
C++ Program To Find Sum of First N Natural Numbers
Last Updated: 02 August 2023
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...read more
image
C++
C++ Programs
C++ Basic Programs
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
C++
4.1k+ articles
Strings
3.2k+ articles
C++ Programs
2.4k+ articles
School Programming
1.4k+ articles
STL
1.2k+ articles
CPP Examples
700+ articles
cpp-string
140+ articles
C++ String Programs
5+ articles
GCD of Two Numbers in C++
Last Updated: 07 March 2025
GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that exactly divides both numbers. In this ...read more
C++
C++ Programs
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 ...read more
image
C++
C++ Programs
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 ...read more
image
C++
C++ Programs
C++ Basic Programs
C++ Program To Check Whether a Number is Prime or not
Last Updated: 17 October 2022
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 na ...read more
C++
C++ Programs
C++ Basic Programs
C++ Program to Print Prime Numbers from 1 to n
Last Updated: 16 October 2024
A prime number is a natural number that has only two divisors, which are 1 and itself. In this article, we will learn how to print all the p ...read more
C++
C++ Programs
C++ Basic Programs
CPP Examples
C++ Program To Find LCM of Two Numbers
Last Updated: 12 September 2023
LCM (Least Common Multiple) of two numbers is the smallest number that is divisible by both numbers. For example, the LCM of 15 and 20 is 60...read more
image
C++
C++ Programs
C++ Basic Programs
C++ Program to Check Whether Number is Even or Odd
Last Updated: 15 October 2024
A number is even if it is completely divisible by 2 and it is odd if it is not completely divisible by 2. In this article, we will learn how ...read more
C++
C++ Programs
C++ Basic Programs
C++ Bit Manipulation
CPP Examples
Add Two Numbers in C++
Last Updated: 11 October 2024
Given two integers, the task is to add these integer number and print their sum in C++.ExamplesInput: a = 11, b = 9Output: 20Explanation: Su ...read more
cpp-operator
C++
School Programming
C++ Programs
C++ Basic Programs
std::gcd | C++ inbuilt function for finding GCD
Last Updated: 31 January 2023
In many competitive programming problems, we need to find greatest common divisor also known as gcd. Euclids algorithm to find gcd has been ...read more
School Programming
C++ Basic Programs
C/C++ Puzzles
Conversion of whole String to uppercase or lowercase using STL in C++
Last Updated: 10 January 2023
Given a string, convert the whole string to uppercase or lowercase using STL in C++.Examples:For uppercase conversionInput: s = "String"Outp ...read more
Strings
STL
cpp-string
School Programming
C++ Basic Programs
DSA
C++ String Programs
Different Methods to Reverse a String in C++
Last Updated: 23 April 2025
Reversing the string means the last character will be the first character, second last character will be second character and so on. In C++, ...read more
STL
cpp-string
C++
C++ Basic Programs
C++ Program to Check Prime Number
Last Updated: 05 May 2025
A Prime Number is a natural number greater than 1 that has no positive divisors other than 1 and itself.Examples:Input: n = 29Output: 29 is ...read more
C++
C++ Programs
C++ Basic Programs
1 2 >>
Last
1 2 >>
Last
1 2 >>
Last
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox