Friday, June 4, 2021

program for make a series and sum of series (POP) (135)

#include<iostream>

using namespace std; 

int main()

{

   long int i,j,n,t=9;

int sum=0;

cout<<"enter the number of term:";

cin>>n;

for(i=1; i<=n; i++)

{

sum=sum+t;

cout<<t<<endl;

t=t*10+9;

}

cout<<"sum of the series:"<<sum<<endl;

} 

No comments:

Post a Comment