Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes

C++ Programming Code Examples

C++ > If Else and Switch Case Code Examples

If Statement - display even numbers

C++ Program to Find LCM of two Integers - Examples on different ways to calculate LCM ("Lowest Common Multiple") of two integers using loops and decision making statements. "LCM of two integers" a and b is the smallest

Use the Break Statement in C++ language - It's used in switch case control structure after the case blocks. Generally all cases in switch case are followed by a "Break Statement" to avoid the subsequent cases (see the example

C++ Programming Code Swap two Strings - To swap two string in C++, enter the 2 strings, and store both the 'string' in variables say str1 & str2. To swap 2 strings, first make a variable say temp of the same type. 'Place the string1'

Trim Leading & Trailing white spaces from - I already explained how to remove leading as well as trailing white space characters from a given string. In this program we will Combine the logic of both in a single program. Logic to

C++ Program Finds HCF of Two Numbers - To find the HCF ('Highest Common Factor') or GCD (Greatest Common Divisor) of 2 or more numbers, make prime factors of the numbers and choose the common prime factors. Then

Check Whether the Number is Palindrome - If the reversed integer is equal to the integer then, that number is a palindrome if not that number is not a palindrome. In program, use is asked to enter a 'positive number' which is

C++ Byte Alignment in a struct Algorithm - Get size of the current type. Align depens on the next type and also alignment defined by #pragam pack(#). Offset will be minimum of this size. If the "size of next type" is less than

C Armstrong numbers between an interval - Declare function to print Armstrong numbers in given range. Lets give a meaningful name to function. Say "printArmstrong()" function prints all Armstrong numbers in given range.