## C++ Program to Find Divisors of a Number

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: 6 Divisors of 6 are 1 2 3 6

## C++ Program to Find Sum of Digits of a Number

Below I have shared C++ program to find sum of digits of a number. For example given number is 238 then sum of digits will be 13. I am using very simple logic. If we find mod of any number by 10 then the result is the last digit of the number. For example 123%10 …

## C++ Program to Find Sum of First n Natural Numbers

Here I have given C++ program to find sum of first n natural numbers. First of all I am reading 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 comment section. C++ Program to Find Sum of First …

## C++ Program to Check Given Character is Uppercase, Lowercase, Digit or Special Character

Below I have shared 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 an then compare it with ASCII values given below. Uppercase Alphabet: 65-90 Lowercase Alphabet: 97-122 Digit: 48-57 If ASCII value of character is other …

## Program for Square Root in C++

Square root in C++ can be calculated using sqrt() function defined in math.h header file. This function takes a number as an argument and returns the square root of that number. Below I have shared a program to find square root in C++. If you have any problem then you can freely ask it by …

## Factorial Program in C++

Below I have shared the factorial program in C++.   Factorial is the product of a number and all the numbers below it. For example factorial of 4 is equal to 24.   If you have any problem regarding below factorial program in C++ then you can freely ask it by commenting below. Factorial Program …

## C++ Program to Find Greatest Number Among Three Numbers

Below I have shared C++ program to find greatest number among three numbers. For example among three numbers 5, 13 and 7, the greatest number is 13. If you have any problem regarding above greatest number program then you can ask it by commenting below. C++ Program to Find Greatest Number Among Three Numbers   …

## C++ Program to Check Number is Odd or Even

Below I have shared the C++ program to check a number is odd or even. For example if user enters an odd number like 5 then the output will be Odd number and if user enters even number like 8 then output will be Even number. If you have any problem regarding below odd or …