KnowledgeBoat Logo

Computer Studies

Draw a flowchart and write a program in QBASIC to display 10 different values of the expression (a + b)2. Take the values of a and b as inputs after each iteration.

QBASIC: For-Next Statements

13 Likes

Answer

Flowchart

Draw a flowchart and write a program in QBASIC to display 10 different values of the expression (a + b)^2. Take the values of a and b as inputs after each iteration. Class 7 ICSE Understanding Computer Studies.

QBASIC Program

Cls
For I = 1 To 10
    Input "Enter two values"; A, B
    S = (A + B) ^ 2
    Print "(A+B)^2 = "; S
Next I
End

Output

Enter two values? 2,3
(A+B)^2 = 25
Enter two values? 4,2
(A+B)^2 = 36
Enter two values? 6,3
(A+B)^2 = 81
Enter two values? 5,8
(A+B)^2 = 169
Enter two values? 3,3
(A+B)^2 = 36
Enter two values? 4,4
(A+B)^2 = 64
Enter two values? 5,5
(A+B)^2 = 100
Enter two values? 6,1
(A+B)^2 = 49
Enter two values? 4,8
(A+B)^2 = 144
Enter two values? 3,9
(A+B)^2 = 144

Answered By

6 Likes


Related Questions