Q. Given the following pseudo code:


Use variables: mark of type integer
If mark> 80, display "distinction" If mark > 60 and mark < 80, display "merit"
If mark > 40 and mark < 60, display "pass"
If mark 40 display, "fail" 

Draw a flow chart for the same and dry run the given pseudocode if it is working fine.


Answer :-

Program :-
mark = int(input("Enter marks :- "))
if mark > 40 :
    if mark > 60 :
        if mark > 80 :
            print("Distinction")
        else :
            print("Merit")
    else :
        print("Pass")
else :
    print("Fail")
Output :-

Enter marks :- 94
Distinction
>>>
Enter marks :- 77
Merit
>>>
Enter marks :- 59
Pass
>>>
Enter marks :- 38
Fail
>>>

Flowchart :-

Click on image for clear view.

3 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Please clear the picture we even can’t understand what is written

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post