In this program, we will learn about taking integer input from the user and storing it in the array. Then we will find the sum of all array elements using for loop and finally calculate the average of N input numbers stored in an array. Program code: Output: Note: also read about Python Class Follow Me […]
December 8, 2022 | C++ | No comments
For two variables entered by the user, we must create separate functions for addition, subtraction, division, and multiplication. Program Code: Output: Note: also read about Program to check Palindrome string 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 […]
December 5, 2022 | C++ | No comments
A string is said to be a palindrome if the reverse of the string is the same as the string. For instance, Program Code: Output: Note: also read about Find the Reverse of a 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 […]
December 3, 2022 | C++ | No comments
When a number is reversed, the digits are rearranged in reverse order, starting with the last digit, then the second-to-last digit, and so on, with the first digit appearing last. Program Code: Output: Note: also read about Armstrong Number in C++ Follow Me Please follow me to read my latest post on programming and technology if you […]
November 27, 2022 | C++ | No comments
What is Armstrong Number? The Armstrong number is a number that is equal to the sum of its digits’ cubes. Armstrong numbers include 0, 1, 153, 370, 371, and 407. Let’s look at why 371 is amrstrong in nature: Approach: The approach is to first count the number of digits (or find the order). Let […]
November 23, 2022 | C++ | No comments
What is Factorial of a number? The product of all positive descending integers is the factorial of n. n! represents the factorial of n. As an example: 4! is pronounced “4 factorial” in this context, and it is also known as “4 bang” or “4 shriek.” The factorial is typically used in Combinations and Permutations […]
November 23, 2022 | C++ | No comments
The largest number that divides two or more numbers is the Greatest Common Divisor (GCD) for those numbers. For example: Let’s say we have two numbers 45 and 27. So, the GCD of 95 and 30 is 5. Program Code: Output: gcd() is a recursive function in the preceding program. It contains two parameters, a […]
November 20, 2022 | C++ | No comments
The Fibonacci Series generates the next number by adding two preceding numbers. The Fibonacci sequence begins with two numbers, F0 and F1. F0 and F1 can have initial values of 0 and 1, respectively. For instance, Program Code: Output: Note: also read about Convert Decimal to Binary Follow Me Please follow me to read my latest […]
November 18, 2022 | C++ | No comments
Given a decimal number as input, we need to write a program to convert the given decimal number into an equivalent binary number. Examples: Algorithm for Converting Decimal to Binary: Step 1: Divide the number by 2 and store the remainder in an array (modulus operator). Step 2: Divide the number by 2 using the […]
November 17, 2022 | C++ | No comments
Find the grade of the student based on the marks obtained in five subjects. Let the grade be calculated based on the following pattern: Average Mark Range Grade 91-100 A1 81-90 A2 71-80 B1 61-70 B2 51-60 C1 41-50 C2 33-40 D 21-32 E1 0-20 E2 To calculate a student’s grade based on total marks […]
November 17, 2022 | C++ | No comments