C++ Program to Print First 10 Prime Numbers
Here is the C++ program to print first 10 prime numbers. Output First Ten Prime Numbers Are 2 3 5 7 11 13 17 19 23 29
Here is the C++ program to print first 10 prime numbers. Output First Ten Prime Numbers Are 2 3 5 7 11 13 17 19 23 29
A series in which each number is the sum of the preceding two numbers is called the Fibonacci series. For example 0 1 1 2 3 5 8 13 . . . . . Below is the program to find Fibonacci series in C++. Output: How many numbers?5Fibonacci series0 1 1 2 3
This C++ program will find the sum of squares of n natural numbers. Starting from 1, 2, 3, etc are called natural numbers. For example: n = 3 Then, Sum = 12 + 22 + 32 = 14 Output: Enter any number: 50Sum=42925
Here you will get a C++ program to check whether a number is a palindrome or not. A number is a palindrome if it is equal to its reverse. For example, 121 is a palindrome because if we reverse the order of digits then the number so obtained is equal to the original number. Output: …
Below is the C++ program to find all the divisors of a number. A divisor is a number that divides another number completely. For example, D is the divisor of N if N%D=0. Output: Enter the number: 6Divisors of 6 are 1 2 3 6
Below I have shared a C++ program to find the sum of the digits of a number. For example, given number is 238 then the sum of digits will be 13. I am using very simple logic. If we find the mod of any number by 10 then the result is the last digit of …
Here I have given C++ program to find the sum of the first n natural numbers. First of all, I am reading the value of n and then calculating the sum using for loop. If you have any doubts related to the program then feel free to ask in the comment section. C++ Program to …
C++ Program to Find Sum of First n Natural Numbers Read More »
Below I have shared a C++ program to check whether a given character is an uppercase or lowercase alphabet, a digit, or a special character. First of all, I read a character and then compare it with the ASCII values given below. If the ASCII value of the character is other than the values mentioned …
C++ Program to Check Character is Uppercase, Lowercase, Digit, or Special Character Read More »