MTS ..... Muhammad Tahir Shahzad, B.C.S Honours [ 2000-04 ], G.C. University Lahore formerly Government College Lahore, Pakistan. All the Programs, Projects and Games in C++, C, Visual C++, Visual Basic, Java and Assembly Language are written by MTS. This new interface of the web site is exclusively designed by MTS. This web site is uploaded on two servers at the same time. The url "www.mts-home.cjb.net" is a redirection url of [ http://mtshome.sw3solutions.com ] and the url "www.mtshome.cjb.net" is a redirection url of [ www.geocities.com/mtahirshahzad ]. Please send your Comments and Suggestions about the website to MTS at mts_home@hotmail.com.
MTS-HOME
C++  :::  BASIC PROGRAMMING
Home
C
C++
Java
Games
Projects
Libraries
Visual C++
Visual Basic
Visual Prolog
Assembly Language
About
Utilities
Feedback
Links Exchange
Add To Favorites
Make Your Homepage
This section C++ : Basic Programming contains source codes of many Programs that are the Basics of Programming in C++. If you have not grip on these Basic Topics of C++, in my opnion, you cannot learn Advance Topics of C++.

select one of the Topics listed below:
Input - Output - Variables - Constants
Bitwise Operators
Conditional Statements
Loops - Continue/Break Statement
Recursion
Functions
Arrays
Pointers - Strings
Miscellaneous Programs
Note:
All the given files are in zip format, which can be uncompressed with the help of a compression tool. If you do not have any tool, then you can get one from Utilities : Compression Tools.
Input - Output - Variables - Constants
CPP-001 A C++ Program to print some text.
CPP-002 A C++ Program to print some text on two separate lines.
CPP-003 A C++ Program to find the sizes, addresses of the variables of type int, float and char.
CPP-004 A C++ Program that reads two numbers from user, computes and display their sum.
CPP-005 A C++ Program to illustrate the declaration, initialization and printing of a constant variable.
CPP-006 A C++ Program to illustrate the use of refrence variables.
Bitwise Operators
CPP-147 A C++ program to show the use of Bitwise operator (|) OR.
CPP-148 A C++ program to show the use of Bitwise operator (&) AND.
CPP-149 A C++ program to show the use of Bitwise operator (^) XOR.
CPP-150 A C++ program to show the use of Bitwise operator (<<) LEFT SHIFT.
CPP-151 A C++ program to show the use of Bitwise operator (>>) RIGHT SHIFT.
Conditional Statements
CPP-007 A C++ Program that reads marks obtained by a student in a test of 100 marks and print pass if marks are greater than or equal to 50.
CPP-008 A C++ Program that reads marks obtained by a student in a test of 100 marks and prints pass if they are grater than 50 and otherwise it prints Fail.
CPP-009 A C++ Program that reads a number and prints even if the number is even and prints odd if the number is odd.
CPP-010 A C++ Program that reads marks obtained by a student in a test of 100 marks and computes his grade according to the following criteria.
Marks>=80 grade=A
Marks>=70 & <80 grade=B
Marks>=60 & <70 grade=C
Marks>=50 & <60 grade=D
Otherwise grade=F   [ Using nested if-else notation ].
CPP-011 A C++ Program that reads marks obtained by a student in a test of 100 marks and prints pass if they are grater than 50 and otherwise it prints Fail. [ using compact if-else notation ]
CPP-012 A C++ Program that reads marks obtained by a student in a test of 100 marks,assign and print the grade. if marks are grater than 50, grade=P and otherwise grade=F. [ using compact if-else notation ]
CPP-013 A C++ Program that reads marks obtained by a student in a test of 100 marks and computes his grade according to the following criteria.
Marks>=80 grade=A
Marks>=70 & <80 grade=B
Marks>=60 & <70 grade=C
Marks>=50 & <60 grade=D
Otherwise grade=F    [ Using switch-case statements ]
CPP-014 A C++ Program that reads two integers and an operator, evaluates and displays the result. [ using switch-case statements ]
Loops - Continue/Break Statement
CPP-015 A C++ Program that prints the first 10 integers. [ using for loop ]
CPP-016 A C++ Program that prints odd numbers form 0 to 50. [ Using for Loop ]
CPP-017 A C++ Program that reads a number, coumputes and displays its factorial. [ using for loop ]
CPP-018 A C++ Program to print a histogram in the following patterns.
                    *                          **********
                    **                        *********
                    ***                       ********
                    ****                      *******
                    *****                     ******
                    ******                    *****
                    *******                   ****
                    ********                  ***
                    *********                 **
                    **********                *
[ using nested for loop ]
CPP-019 A C++ Program to print a diamond. [ using nested for loop ]
CPP-020 A C++ Program to print a histogram in the following pattern.
                    **********
                    **********
                    **********
                    **********
                    **********
[ using nested for loop ]
CPP-021 A C++ Program that computes and display the sum of first ten integers. [ using for loop ]
CPP-022 A C++ Program that computes and display the square of first ten integers. [ using for loop ]
CPP-023 A C++ Program that prints first 20 integers. [ using while loop ]
CPP-024 A C++ Program that prints first 20 integers in reverse order. [ using while loop ]
CPP-025 A C++ Program that prints (a) All the odd numbers between 0 to 50, (b) All the even numbers between 0 to 50, (c) All the numbers that are divisible by 5 between 0 to 50. [ using while loop ]
CPP-026 A C++ Program that reads a number, coumputes and displays its factorial. [ using while loop ]
CPP-027 A C++ Program that reads a number and displays it with its digits in reverse order. [ using while loop ]
CPP-028 A C++ Program that reads a number and displays it with its digits in reverse order. [ using do-while loop ]
CPP-029 A C++ Program that reads a number,coumputes and displays its factorial. [ using do-while loop ]
CPP-030 A C++ Program that prints all the even numbers between 0 to 50. [ using while, do-while and for loop ]
CPP-031 A C++ Program to illustrate the use of the break statement.
CPP-032 A C++ Program to illustrate the use of the continue statement.
Recursion
CPP-033 A C++ Program that computes the nth term of the fibonacci series and also print the series upto the nth term.
CPP-034 A C++ Program that reads a numbers, then coumputes and displays the factorial of the given number.
CPP-035 A C++ Program to solve the mystery of Towers of Hanoi.
Functions
CPP-036 A C++ Program to illustrate the use of parameterless function.
CPP-037 A C++ Program that find the largest integer out of three integers provided and display the largest integer. [ using functions with no return type ]
CPP-038 A C++ Program that find the largest integer out of three integers provided and display the largest integer. [ using functions with return type ]
CPP-039 A C++ Program to illustrate the use of call-by-value method in functions.
CPP-040 A C++ Program to illustrate the use of call-by-refrence method in functions.
CPP-041 A C++ Program to illustrate the use of inline functions.
CPP-042 A C++ Program to illustrate the use of default argument function.
CPP-043 A C++ Program to illustrate the use of function overloading.
CPP-044 A C++ Program that find the distance between two points in 2D and 3D space using function overloading.
CPP-045 A C++ Program to interchange the values of two int, float and char using function overloading.
CPP-046 A C++ Program to find the value of sin at any given angle. [ using built-in function ]
CPP-047 A C++ Program that reads two positive numbers n and r s.t. n>r, then coumputes and displays the value of nCr.
CPP-048 A C++ Program to illustrate the use of some builtin functions of header file "math.h".
CPP-049 A C++ Program to illustrate the difference between the use of strcomp, strcmpi and stricmp.
CPP-050 A C++ Program that differentiate b/w the variables of the storage class Auto and Static along with global variables.
Arrays
CPP-051 A C++ Program that declares and initialize an array of size 10 of type int with some elements. Also computes and display the largest element of the array.
CPP-052 A C++ Program that declares an array of size 10 that contains integers, initialize all elements by 0 and print the contents of the array. Then place consecutive even numbers starting from 2 and again display the contents of the array again and also computes and display the sum of the array.
CPP-053 A C++ Program that declares an array of size 10 and type int and reverse the contents of the array.
CPP-054 A C++ Program to print a histogram in the following pattern.
                    *
                    **
                    ***
                    ****
                    *****
[ using array ]
CPP-055 A C++ Program to print an array using funtion definition.
CPP-056 A C++ Program that reads the marks obtained of ten students out of 100 in four papers. It computes and display the total marks and status of each student.
CPP-057 A C++ Program to illustrate the difference b/w passing the whole array and the single array element as a parameter to a funtion.
CPP-058 A C++ Program to illustrate the Bubble Sorting of arrays.
CPP-059 A C++ Program to search an element in an array using Linear search.
CPP-060 A C++ Program to search an element in an array using Binary search.
CPP-061 A C++ Program that reads the marks obtained of ten students out of 100. It also computes the average, lowest and highest marks. Then shows the difference of marks of every student from the average marks.0
CPP-062 A C++ Program to declare an 2D array of 3*4 size of type int and initialize it by 5,10,15,... and print the contents of the array in a single line, row by row and also display its sum.
Pointers - Strings
CPP-063 A C++ Program to illustrate the use of operator '*' and '&'.
CPP-064 A C++ Program to illustrate supplying of values to pointer variables.
CPP-065 A C++ Program to illustrate adding values to the contents of variables whose addresses are in pointers.
CPP-066 A C++ Program to illustrate the use of pointer to pointers.
CPP-067 A C++ Program to illustrate the functions returning pointers.
CPP-068 A C++ Program to illustrate the operations that can be performed on pointers.
CPP-069 A C++ Program to illustrate the 2D array of int using pointers.
CPP-070 A C++ Program to illustrate the 2D array of char [string] using pointers.
CPP-071 A C++ Program to print an array before and after adding 5 to its contents using pointers.
CPP-072 A C++ Program to illustrate the use of call-by-refrence method using pointers.
CPP-073 A C++ Program to print, read and calculate sum, smallest, largest element an array using pointers.
CPP-074 A C++ Program to illustrate the different features of an array of char known as string.
CPP-075 A C++ Program to convert lower case letters to upper case letters [ example of using non-constant pointers to non-constant data ].
CPP-076 A C++ Program to print a string char by char [ example of using constant pointers to non-constant data ].
Miscellaneous Programs
CPP-132 A C++ Program to find a Book in the list of Books.
CPP-134 A C++ Program to find whether a year is a leap year or not.
CPP-135 A C++ Program to swap two variables using header file "SWAP.h".
CPP-136 A C++ Program to find the day of a week of a given date from 15 october 1582 to end of universe using arrays.
CPP-137 A C++ Program to convert a decimal noumber into binary, octal and pental code. [ using arrays and functions ]
CPP-139 A C++ Program to covert a given decimal number into Roman Code.
CPP-140 A C++ Program to covert a given Decimal Number into English Code.
CPP-143 A C++ Program to add two integers without using "+" operator.
CPP-144 A C++ Program to print the factorial of first five elements of the fibonacci series.
CPP-145 A C++ Program to add two integers of any length.
CPP-146 A C++ Program to read a Non-Linear function in one variable, then evaluate it and display its result.
[ Home | C | C++ | Java | Visual Prolog | Games | Projects | Libraries | Visual C++ | Visual Basic | Assembly Language | About Me ]
  Copyright © 2000-2005
  Muhammad Tahir Shahzad
Recomended Browsers:
Internet Explorer 5.0+
Recomended Resolution:
800x600*
Report a Dead Link or Bug to MTS:
mts_home@hotmail.com