Computer Science, asked by WHATDAHECK, 3 months ago

Write a program in QBASIC and draw a flowchart

to find the sum of the following series :

S = 1 +22 + 33 ……………. N​


allysia: uh do you mean 11 + 22 + 33 ?
WHATDAHECK: I just copied the question and pasted it
allysia: can't figure out the pattern...if there was 11 instead of 1 it would make sense

Answers

Answered by allysia
2

Language:

Qbasic

Flowchart:

Consider the attachment.

Program:

CLS

INPUT "enter n:";n

sum=1

FOR i= 2 TO n:

sum=sum+(11*i)

NEXT i

PRINT sum

END

Output:

Consider the attachment.

Explanation:

  • Line 1: Clears screen.
  • Line 2: Takes input in n.
  • Line 3: Initializes sum.
  • Line 4: Runs loop till n.
  • Line 5: Increases sum by 11*i where i is no. of times the loop ran.
  • Line 6: Prints final value of sum.
  • Line 7: Ends the program.

Attachments:
Similar questions