C++ Homework Help

Main menu


C++ Tutorial

www.cpp4u.com > C++ Source Code > Beginner


Source code to start programming
Variables and data types
Variables and data types



e^x Formula -
Program that calculate the value of e^x using the formula

Program that finds the factorial of a number

Program that takes two rational number as input and perform the arithmetic operations on it. output is also in the rational form

Program that takes any decimal number as input and prints its binary equivalent.

Program that finds GCD (Greatest Common Divisor) of two numbers..

Program that divides a number with another number using subtraction method.

Program that takes any amount as input and print the coinage.

Program that takes a matrix as input and print its transpose.

Program that shows the current position of the cursor which can be moved with the help of arrow keys.

Simple Calculator in C++ -
Simple Calculator Program in C++.

Cenelia Gonzales C++ sources -
Collection of algorithm source code includes. String Tokenizer, Fuzzy String Matching, Rational Number Class, Simple FSM, Equation Solver, Guessing Games.

Collection of sources C,C++ and other languages by Muhammad Tahir Shahzad. C++ sections includes. Algortihms, Data Structures, Numerical Analysis and other topics.

squares.zip -
A typical kiddie puzzle game involving scores. The aim of the game is to arrange all squares in order or to make a picture out of them. Once you finish a puzzle you get 100 points. Every move you make costs you 10 points. Once you go zero the game is over. So the less moves you make, the more you score. Author Enrico Lorenzo

password.zip -
This is a simple C program which basically compares two strings and reports whether they are the same or not. Author Anish Pasari

fibonacci.zip -
This program has its own library file swap.h. You can use this file to swap the values in any 2 variables. The program generates the fibonacci series till the desired element. Please read the readme file for details. Author Apurva Mehta

pascal.zip -
This offers an easy to use class to output the pascal's triangle fully to a certain limit or only a particular row. The class offers functions like displayrow(int) and displaycomplete(int). Author Apurva Mehta

orderform.zip -
This Program uses classes to represent an order form. If you are learnig about how to use classes then take a look at this program. Author Raghav Garg

Bitwise AND OR operation -

Number Test -
Description:This program executes a very precise test to determining if the user input is a number. This test valid for any real numbers.Example: +56, -896.223, 123,.2335, 3.141592653 are all accept as numbers. But 142-555, 23+56, (55*898) etc are not accept as numbers by this program.By: Gonzales Cenelia

Lines Counter -
Have you ever wanted to count the lines of your code in C or C++ without the commentaries and blank lines,well with this program you can do it. I hope that you people will find it useful ! If so,please rate it. This code can be use freely for none commercial purpose If you ever want to use it for some commercial purpose,please contact me first.author: Gonzales Cenelia

String Tokenizer Class -
Breaks the input strings into tokens

58 C++ Progs -
58 C++ programs are designed for beginers to enhance their knowlege by understanding how to devlop Logic how to approach towards given problem.,It consist of program for maintaining Library System ,Banking SystemAnd much more... Auther Vivek Patel

Text Alignment -
Text Alignment will provide you the source-code of Right Alignment and Center Alignment. Auther Vivek Patel

C++ Programming at neonprimetime's den -
Code by Justin Miller's in C++ and other languages, examples, and lots of links to helpful resources

cpp comments -
Describing your program for future readers of your code. author: Justin C. Miller

DoWhile -
Another way to loop, do-while, or just a simple while statement.

For Loop -
The most common way to loop (which means to do something over and over again).Author: Justin C. Miller

Functions -
Your program is better if it's split up into small tasks. These tasks are called functions.Author: Justin C. Miller

If Else -
Common conditional statement, if this, do that, else do this. Author: Justin C. Miller

Infinite Loop1 -
Infinite loops (go on forever) are usually something to avoid, so learn what they are.For Loop. Author: Justin C. Miller

Infinite Loop2 -
Infinite loops (go on forever) are usually something to avoid, so learn what they are.While Loop.Author: Justin C. Miller

Infinite loop3 -
Infinite loops (go on forever) are usually something to avoid, so learn what they are.Do While.Author: Justin C. Miller

InputOutput -
Basic input from the keyboard and output to the screen.Author: Justin C. Miller

Passing by Reference or Value -
When passing variables to a function you can either to by Reference or by Value. Learn what is what here.Author: Justin C. Miller

SemiColons -
The semicolon is one of the main cause of many and most compilation errors. Learn where to put them and where not to put them.Author: Justin C. Miller

Variables -
How to store data, and the different types of variables (int, char, string, bool, etc.)Author: Justin C. Miller

Pointers and Link Lists -
Pointers and Link Lists.author: Justin C. Miller

Calender -
creating a calendar prints a calendar from reference date to user's date.Author: Justin C. Miller

Input using cin -
Taking Input using cin.getLine().Author: Justin C. Miller

compare 2 sum -
Enter 2 numbers and compare them also print out the sum of the 2 numbers.Author: Justin C. Miller

use of assert function -
if the number entered in was not greater than six the program would be terminated with an error message if the number was greater than six then the program continues and in this case Hi! is printed out. Author: Justin C. Miller

Draw a diamond with astericks(*) -
simple diamond shape using * 's Author: Justin C. Miller

Find Numbers Divisible by your input! -
list all numbers divisible by n from 1 - 100 .Author: Justin C. Miller

Quickest Way to DETERMINE EVEN & ODD Numbers -
looks at JUST THE 1ST BIT of a number (which is the determining if bit 0 is set)if bit 0 is set, it is an odd number else it is an even number .Author: Justin C. Miller

Roll 2 dice (2D array), order matters(keep track of rolls) -
rolls dice, keeps track with a table of the rolls for each possible pair Author: Justin C. Miller

Calculate Salary (using hours + hourlyrate) -
Calculate salary .Author: Justin C. Miller

simple simulation of DOS PROMPT -
very very very simple simulation of MS-DOS prompt .Author: Justin C. Miller

Toll Road Payment Simulation -
Calculate a toll for road based on number of axles on the vehicle....50 cents plus 20 cents per axle .Author: Justin C. Miller

Numbers of Days you've been ALIVE! -
Calculate the approximate number of days you have been alive (ignore leap year) Multiply your age in years by 365 and add in the number of days from your birthday to today's date .Author: Justin C. Miller

Convert degrees to radians -
This program converts a degrees into radians, for examples 180 degress = 6.24 ( or 2 * pi) radians .Author: Justin C. Miller

Convert radians to degrees -
This program converts a radians into degrees, for examples (2 * pi) radians = 180 degrees .Author: Justin C. Miller

Print a year in Roman Numerals -
scope operator:: .Author: Justin C. Miller

Convert a dollar amount to all coins -
this program takes a dollar amount and converts it all to coins finding the least amount of coins needed .Author: Justin C. Miller

print out a date in good format -
this program takes a date entered with numbers by the user and prints it out in a decent format using words .Author: Justin C. Miller

Example of a class in a class (cpp) -
Example of a class in a class (cpp) .Author: Justin C. Miller

Getting Yes/No replies from the user -
Getting Yes/No replies from the user .Author: Justin C. Miller

Making Sure You Get an Integer from user -
Making Sure You Get an Integer from user .Author: Justin C. Miller

Convert Fahrenheit to Celsius -
to change from farhenheit to celsius .Author: Justin C. Miller

Find Sum of All odd numbers 1-N -
adds up the total of the odd numbers from 1 - n .Author: Justin C. Miller

Enter 10 numbers, sort them -
input 10 numbers then sort from least to greatest .Author: Justin C. Miller

Enter a Range A to B, Add em all up! -
input x and y, then add up the sum of numbers x to y or y to x .Author: Justin C. Miller

Fibonaci Series -
A C++ Program to computes the n_th term of the fibonacci series using Divide and Conquer Strategy. Author:Muhammad Tahir Shahzad


Top Categories