Learn to Program Step-by-Step

C++ sample programs

Select one of these sample programs

Select one of these sample programs

Topic Programs and Tutorials
Introduction to C++ hello, hello, hello,
Input - process - output inch1, inch2, inches to centimeters, age, circle, purchase1, 2, 3, 4
Printing special characters inches to centimeters, inches to feet and inches
Formatting output tax (prints 2 decimal places),
Arithmetic operations Tutorial, grades, Feet and Inches, Feet and Inches 2, average, avg. rounded,
hypoteneuse, hypoteneuse2, line length, total, total2,
Finding percents Purchase, Purchase2
math functions: cmath Length of line,
Boolean expressions test, grades2, Discount for children, Discount for Children and Seniors,
Tip1, Tip2, Tip3, order2, retire, sale, sort2, swap
And &&, Or || month, rat, month2,
Nested If/Else Letter0, Letter1, Letter2, Letter3, Letter 4, Letter5
Question mark  
Switch nonsense, calculator, pay1, pay2, pay3, pay4, season, 2, 3, 4, 5, 6, 7,
tip1, tip2,
Loops, while Count1 (while loop), count, count, count, double, endless, +1, ++, blast, total, totalY, totalN, whileY, total2,
Loops, for Count3 (for loop), Blast off, Alphabet, powers2, binary, by5, down by 5, children,
by .5, fractions, total3, totalN, inches, fractions, countPassFail, countPass2,
Loops, do Count2 (do loop), 1-12, notY, doY, doTotal,
Loops, nested grades,
Functions heading, circle, odd, letter grade, Letter Grade 5, count down, grade, tip,
shipping, function overloading
Functions: pass by reference Addresses, Area Circle, triple, grades3, pay, sort1, sort3, sort-swap, sort-ref,
Menu driven programs area, area1, area2, area3, area4, area5, area6, fast food, grades, grades2,
template, payroll, shipping,
Arrays int array, prices, lookup price, prices2, prices3, sort3, sort-swap, 2, julian1, julian2,
Strings farm, fast food, readName, soc-sec0, 1, 2, 3, sort2, sort3, strcat, strncat,
strchr, strcmp, stricmp, strncmp, strnicmp, strcpy, strncpy, strlen, strstr, 2,
Array of strings months, read names, name array, binary search, farm, filename, reverse,
seq. search, search,
Files inches,numbers, read file, read file2, read1, readNames, readNames to array, 2, 3,
Inventory control inv1, inv2, inv3, inv4, inv5
Miscellaneous current year, random number: dice, dice,
iomanip setbase, setprecision, setw, decimal places
Like us on Facebook:

OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: June 21 2016 11:32:30.