I'd use a for loop within a for loop. The outer for would count from 1 to the number entered (so 1-4 if the user enters 4). The inner for would count from 1 to the outer loop variable (so if the outer loop variable is 3, then the inner loop would count from 1 to 3). Each time you display a number just add it to a running total. The rest is just printf/cout statements. Try it and see how far you get. This is an easy task.
fill the dots and you have it Code: #include <stdio.h> int main(){ int i,j,final,result=0; printf("\nenter final number for series:"); scanf("%d",&final);getchar(); for (i=1;...;i++){ if (i>1) printf("("); for (j=1;...;j++){ if (...) printf("%d+",j); else printf("%d",j); result+=j; } if (...) printf(")"); if (...) printf("+"); } printf("=%d",result); getchar(); return 0; }