Question: Flowchart for: 1+2+3+5+8… … … 20th item Draw a flowchart of Fibonacci sequence? Start A=0, Counter=1, B=1, C=0 C=A+B A=B B=C Counter = Counter +1 Print C
Private Sub Command1_Click () A=0 B=1 Counter =1 C=0 Do C=A+B A=B B=C Counter=Counter+1 Print C Loop While Counter <= 5 End Sub
Yes Counter<=5 No Exit Procedure
Stop
Draw a flowchart for Fibonacci sequence and Summation of Fibonacci sequence? ` Start
A=0, Counter=1, B=1, C=0, Sum=0
Private Sub Command1_Click() A=0 B=1 Counter =1 C=0 Sum=0 Do C=A+B A=B B=C Counter=Counter+1 Sum= Sum+ C Print C Loop While Counter <= 5 Print Sum
C=A+B A=B B=C Counter = Counter +1 Sum = Sum + C
Print C
Counter<=5
Yes
End Sub
No Print Sum
Stop S M Sumsul Islam
PU/ProgInBus/FlowChart/56
Question: Flowchart for: ax2 + bx + c =0
Start
Read A,B,C
Delta=B^2-4*A*C Delta<0
“Complex
Delta>0
“Real “Equal X1=(-b+ delta)/(2*A) X2=(-b- delta)/(2*A) Print X1
Print X2
Stop
Private Sub Command1_Click() a=1 b = -2 c = -3 result = (b ^ 2 - 4 * a * c) If result < 0 Then Print "Complex Root" ElseIf result > 0 Then Print " Real root" Else: Print " Equal Root" End If X1 = (-b + result ^ 0.5) / (2 * a) X2 = (-b - result ^ 0.5) / (2 * a) Print X1 Print X2 End Sub
S M Sumsul Islam
PU/ProgInBus/FlowChart/56