Skip to content

C++ Snippets; Visual Studio Project; From Basic to Advanced Level

License

Notifications You must be signed in to change notification settings

Lali67/Cpp_Snippet

Repository files navigation

Cpp_Snippet

This repository contains small C++ programs in Visual Studio project style in order to help learning the logic of this programming language.

01-Basic Folder

This folder contains examples on basic concepts of C++ programming like: loops, functions, pointers, structures etc. All programs (Console App) in this page are tested and verified in Visual Studio.

Link Summary
001-Hello World.cpp Simple C++ program to display "Hello, World!" on the screen
002-Print Number Entered by User You'll learn to print the number entered by a user using C++ cout statement.
003-Add Two Integers The user is asked to enter two integers. Then, the sum of those two integers is stored in a variable and displayed on the screen.
004-Find Quotient and Remainder The user is asked to enter two integers (divisor and dividend) and computes the quotient and remainder.
005-Find Size of int_float The program declares 4 variables of type int, float, double and char. Then, the size of each variable is evaluated using sizeof operator.
006-Swap Numbers program uses temporary variable to swap numbers
007-Check Whether Number is Even In this example, if...else statement is used to check whether a number entered by the user is even or odd.
008-Whether a character is Vowel or Consonant if...else statement is used to check whether an alphabet entered by the user is a vowel or a constant.
009-Find Largest Number Among Three Numbers to find the largest number among three numbers using if, if else and nested if else statements.
010-Find All Roots of a Quadratic Equation This program accepts coefficients of a quadratic equation from the user and displays the roots (both real and complex roots depending upon the discriminant)
011-Calculate Sum of Natural Numbers This program takes a positive integer from user( suppose user entered n ) then, this program displays the value of 1+2+3+....+n.
012-Check Palindrome Number This program reverses an integer (entered by the user) using while loop. Then, if statement is used to check whether the reversed number is equal to the original number or not.
013-Whether a Number is Prime Example to check whether an integer (entered by the user) is a prime number or not using for loop and if...else statement.
014-Prime Numbers Between two Intervals Example to print all prime numbers between two numbers (entered by the user) in C++ Programming. This problem is solved using nested for loop and if...else statement.
015-All Factors of a Number Example to find all factors of an integer (entered by the user) using for loop and if statement.
016-Check Leap Year This program checks whether an year (integer) entered by the user is a leap year or not.
017-Find Factorial The factorial of a positive integer n is equal to 123*...n. You will learn to calculate the factorial of a number using for loop in this example.
018-Generate Multiplication Table Example to generate the multiplication table of a number (entered by the user) using for loop.
019-Display Fibonacci Series In this article, you will learn to print fibonacci series in C++ programming (up to nth term, and up to a certain number).
020-Find GCD Examples on different ways to calculate GCD of two integers (for both positive and negative integers) using loops and decision making statements.

About

C++ Snippets; Visual Studio Project; From Basic to Advanced Level

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published