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)
Welcome to " way2cplusplus.blogspot.in " Objective of this blog is to implement various Computer Science Engineering Lab problems into C++ programming language. These are basically most common Lab Exercise problems based on the curriculum of engineering colleges throughout the Nation. These lab exercises are also relevant to Data structure. Simply C++ programming zone...
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'.
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
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
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
Subscribe to:
Posts (Atom)












