Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Showing posts with label numbers. Show all posts
Showing posts with label numbers. Show all posts

Calculate nPr & nCr

C++ Program to calculate nPr & nCr. This program calculates the value of nCr and nPr. The values of n and r are input by user. We have used 3 functions : 'npr' for calculating nPr , 'ncr' for calculating nCr , factorial to calculate factorial. nPr is calculated by the formula nPr = factorial(n)/factorial(n-r)

Count Number of Vowels

C++ Program To count the number of Vowels in given string. This program calculates the number of vowels in a string using for loop. The string is input by the user using gets(). Using gets() allows the compiler to input the spaces of string also. We have taken a variable count whose value increases by 1 when a vowel in encountered during the scan. So value of count keeps on increasing

check Armstrong number

 C++ Program to check the input number is Armstrong number or not.
Armstrong number c++ program:  A number is armstrong if the sum of cubes of individual digits of a number is equal to the number itself. For example 371 is an armstrong number as 33 + 73 + 13 = 371. Some other armstrong numbers are: 0, 1, 153, 370, 407.

Calculate Average Using Arrays

 C++ Program to Calculate Average of n number, using array.This program takes n number of element from user(where, n is specified by user), stores data in an array and calculates the average of those numbers.This program calculates the average if the number of data are from 1 to 100. If user enters value of n above 100 or below 100 then, while loop is executed which asks user to enter value of n until it is between 1 and 100.

Count Number of Digits of an Integer

 C++ program to count number of digit in an integer. This program takes an integer from user and calculates the number of digits in that integer. For example: If user enters 2319, the output of program will be 4 because it contains 4 digits.This program takes an integer from user and stores that number in variable n. Suppose, user entered 34523. Then, while loop is executed because n!=0 will be true in first iteration.

Find HCF of two number

 C++ Program to find HCF of two number.
The largest integer which is perfectly divisible to two or more numbers is known as H.C.F or G.C.D of those two numbers.There are many ways to find the H.C.F of two numbers is C++ programming.  Below code will take two integers from user and displays the H.C.F of those two integers.This is the best way to find HCF of two numbers.

Swap two Numbers

 C++ Program to Swap to integer value.This program asks user to enter two numbers and this program will swap the value of these two numbers.
Simply use oh three variable as shown in the program a, b & temp.
external variable temp is use to hold the value of a so that it can be use to assign value to b variable.

Check number is Even or Odd

 C++ Program to check the number is Even or Odd:Numbers perfectly divisible by 2 are known even numbers and numbers which are not divisible by 2 are called odd numbers.This program takes an integer from user and checks whether that number is even or odd and displays the result.In this program, user is asked to enter an integer which is stored in variable a. Then, the remainder is found when that number is divided by 2 and checked whether remainder is 0 or not.

Palindrome Numbers

 A palindrome number is a number such that if we reverse it, it will not change. For example some palindrome numbers examples are 121, 212, 12321, -454. To check whether a number is palindrome or not first we reverse it and then compare the number obtained with the original, if both are same then number is palindrome otherwise not. 

Program To Find The Power of any No.....

 Program for determining the power of any integer value. Simply use of "math.h" header function for finding power.
Syntax of power is " pow(no,r) ",where no is the number and r is the power of a number..

Program For Prime No. Series Up to N no ...........

 Program to print the series of Prime Number up to ' n '  number.Here user can input the end limit of series, so for what you waiting for..(keep enjoy)
simply use of two for loop and if else operator
 condition " i%j==0 "helps to determine the Prime no. Any further query leave message....

Reverse Traversing Of Four Digit No........

 Program print the input number , in right to left order (means  reverse traversing)

note: user can only put four digit number , if you want to insert more number leave message ....

Print Fibonacci Series (0,1,1,2,3,5,8...)




Program which use to generate Fibonacci Series up to 0 to 15 ,, you can change the value  15 with your desire value.
The Fibonacci Sequence is the series of numbers 0,1,1,2,3,5,8,13,21,34....
The next number is found by adding up the two numbers before it.
  • The 2 is found by adding the two numbers before it (1+1)
  • Similarly, the 3 is found by adding the two numbers before it (1+2),
  • And the 5 is (2+3),
  • and so on!

Check , given number is PRIME or not .....



Program use to find the input number is prime or not. Simple logic is applied  if(num%i==0) with the help of count variable ,we identify the prime number.

Print Multiplication Table ...



 Program generate the table of any integer up to 20 . If you want to change the value of 20 go to program and change the value of 20 in for loop..                              

Sum of EVEN & ODD number

Program print Addition(sum) of Even number & Odd number. User can define the starting and ending value (so enjoy)

Greater Between Three Numbers...

Program used to identify the greater number among the three number.
User can input any desire valid input in the program.
use of nested if else
Blogger Widgets

Find Us On Google, Just type - way2cplusplus -

If you have any questions on implementing or understanding this C++ Program , shoot me a comment and I'll be glad to help! :) :)