observe the following block of code and determine what happens when x=2? #include<iostream.h> void main ()
{ int a,d,n,sum,teram=0;
cout<<"enter the first term,common difference,"<<"and the number of terms to be summed"<<"respectively:\n"; cin>>a>>d>>n;.
sum=0
int i=1;
cout<<"\n the terms are";.
do
{
term=a+=(i-1)+d;
sum+=term;
cout<<term<<" ";
++i;
}
while (i<=n);
cout<<"\n the sum of A.P. is "<<sum;
}
}
Answers
Answered by
2
Answer:
your code is not understandable and has too many errors..
Explanation:
this can't be answered.
Answered by
0
Answer:
I couldn't understand your words please write your question
Similar questions
Math,
3 months ago
Hindi,
3 months ago
Biology,
7 months ago
English,
7 months ago
Computer Science,
11 months ago
English,
11 months ago
CBSE BOARD X,
11 months ago