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
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...
Showing posts with label series. Show all posts
Showing posts with label series. Show all posts
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
Calculate sum 1 + 2 + 3 +. . . .+n
C++ Program to calculate the sum of a series up to N terms.This program calculates the sum of the series 1 + 2 + 3 +. . . . . . . .
.+n and prints the result on the compiler screen. The last number n is
input by the user. Sum of this series is calculated by the formula :
sum=(n*(n+1))/2. For loop is used to print the whole series upto n and
the sum is printed on compiler screen.
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....
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....
Print Fibonacci Series (0,1,1,2,3,5,8...)
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!
Subscribe to:
Posts (Atom)





