Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

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)

Calculate Simple interest

C++ Program to calculate Simple Interest. This program calculates the simple interest and prints the result on the compiler screen.
Three values i.e principal amount(p), interest rate(r) & time period(t) are input by the user using 'cin'. All three are taken of 'float' type .
The formula for simple interest is : p*r*t/100.The result is shown on compiler screen using 'cout'.

Sum of G.P

C++ Program to calculate sum of finite G.P. This program calculates the sum of the a finite G.P. and prints the result on the compiler screen. The first term 'a', number of terms 'n' and the common ratio 'r' are input by the user. Sum of an G.P. is calculated by the formula : sum=(a*(1-pow(r,n+1)))/(1-r) , nth term by : nth=a*pow(r,n-1) . For loop is used to print the whole series upto n

All Number Patterns

Below is a complete list of all the Number patterns.Outputs of all the codes have been put below the respective codes. This allows the user to view how the code works.


All Asterisk Patterns

Below is a complete list of all the Asterisk patterns. All these codes have been complied in Turbo C++ Compiler. Outputs of all the codes have been put below the respective codes.

 

Calculate Sum of an A.P.

 C++ Program to Calculate sum Of An A.P. series. This program calculates the sum of the an A.P. and prints the result on the compiler screen. The first term 'a', number of terms 'n' and the common difference 'd' are input by the user. Sum of an A.P. is
calculated by the formula : sum=(n*(2*a+(n-1)*d))/2 , nth term by : nth=a+(n-1)*d . For loop is used to print the whole series upto n and the sum is printed on compiler screen
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! :) :)