Print "Type the upper limit (n) ?" Input n K = -1 WHILE K < = n K = K + 2 Sum = Sum + K WEND Print "The sum of all odd numbers up to "; n; "is "; Sum
Find the Sum to n terms of the series 5 5+55+555+ +n Terms
2x+7=n
The sum of 2n, for n= 0 to 29.
n + n+1 + n + 2 = 3n+3 = 3(n+1)
if (n%2==0) sum=n/2*(n+1); else sum=(n+1)/2*n;
main() { int i, n, sum=0; cout<<"Enter the limit"; cin>>n; for(i=0;i<=n;i++) sum=sum+i; cout<<"sum of "<<n<<" natural numbers ="<<sum; getch(); }
Print "Type the upper limit (n) ?" Input n K = -1 WHILE K < = n K = K + 2 Sum = Sum + K WEND Print "The sum of all odd numbers up to "; n; "is "; Sum
Find the Sum to n terms of the series 5 5+55+555+ +n Terms
3 + 7 is an ADDITION sum
(n2 + n)/2 1+2+3+4+5+n= 15+n
That is an unsolvable problem, because there are an infinite number of even numbers. However, with limits, you could say... int NMax = ...; int Sum = 0; for (N=2; N<=NMax N+=2) Sum += N;
Did you mean 1-2+3-4+5-6....till n ?? If yes, then here it is: #include<iostream.h> void main() { int n,sum=0,check=1; cout<<"Enter n "; cin>>n; for(int i=1;i<=n;i++) { sum+=(check*i); check*=-1; } cout<<"The result of series is: "<<sum; }
Successor of n=n+1 Predecessor of n=n-1 Sum=[n+1]+[n-1] Plus 1 plus minus 1= [1]+[-1]=0 [n][n] =2n Hope this helps
2x+7=n
The sum of 2n, for n= 0 to 29.
The sum of (base current) plus (collector current).