By using the + and – operators, we can swap two numbers without using a third variable. Main logic: Program code: Output: Note: also read about Check for palindrome number Follow Me Please follow me to read my latest post on programming and technology if you like my post. https://www.instagram.com/coderz.py/ https://www.facebook.com/coderz.py Rabecca FatimaStaying up to the […]
November 12, 2022 | C++ | No comments
A palindrome number is a number that remains the same when digits are reversed. For example, the number 125521 is a palindrome number, but 1451 is not. Program Logic: First, Declare a variable reverseNum and initialize it with 0. Now, make a while loop till the original number is greater than zero. In every loop, get the last digit […]
November 12, 2022 | C++ | No comments
n1 is compared to n2. If n1 is larger than n2, it is compared to n3. If it is greater than n3 as well, n1 is the max number; otherwise, n3 is the max number. If n1 is not greater than n2, it follows that n2 is greater than n1. After that, n2 is compared to n3. […]
November 11, 2022 | C++ | No comments
A prime number is greater than one and can be divided by one or itself. In other words, prime numbers cannot be divided by anything other than themselves or 1. Prime numbers include 2, 3, 5, 7, 11, 13, 17, 19, 23, etc. Program code: Output: Note: also read about Diamond Pattern Using Numbers Follow Me […]
November 11, 2022 | C++ | No comments
Program code: Output: Note: also read about Floyd’s Triangle Follow Me Please follow me to read my latest post on programming and technology if you like my post. https://www.instagram.com/coderz.py/ https://www.facebook.com/coderz.py Rabecca FatimaStaying up to the mark is what defines me. Hi all! I’m Rabecca Fatima a keen learner, great enthusiast, ready to take new challenges as […]
November 8, 2022 | C++ | No comments
Floyd’s triangle is a triangular array of natural numbers and it is named after Robert Floyd, a renowned computer scientist popularly known for the design of the Floyd–Warshall algorithm. Program code: Output: Note: also read about Pascals triangle. Follow Me Please follow me to read my latest post on programming and technology if you like my post. https://www.instagram.com/coderz.py/ […]
November 8, 2022 | C++ | No comments
Pascals triangle is a triangular array of binomial coefficients. The numbers outside Pascals triangle are all “0”. These “0s” are very important for the triangular pattern to work to form a triangular array. The triangle starts with a number “1” above, and any new number added below the upper number “1” is just the sum […]
November 8, 2022 | C++ | No comments
C++ programming using “*” for Christmas Tree Pattern Program code: Output: Note: also read about Pattern Program Using Star Follow Me Please follow me to read my latest post on programming and technology if you like my post. https://www.instagram.com/coderz.py/ https://www.facebook.com/coderz.py Rabecca FatimaStaying up to the mark is what defines me. Hi all! I’m Rabecca Fatima a […]
November 7, 2022 | C++ | No comments
In this program, we use numbers to generate a pyramid-like pattern. And numbers follow a pattern similar to this: 1 in the first line, 121 in the second line, 12321 in the third line, and so on. Program code: Output: Note: also read about Pattern Program Using Star Follow Me Please follow me to read my […]
November 7, 2022 | C++ | No comments
C++ implementation for pattern printing. Pattern 1: Program code: Output: Pattern 2: Program code: Output: Pattern 3: Program code: Output: Pattern 4: Program code: Output: Note: also read about Sum Of Series 1 + 2 + 4 + 8 + 16 + 32 + . . n Follow Me Please follow me to read my latest […]
November 7, 2022 | C++ | No comments