What is the output of the following flowchart if my choice is 3 and num1=12 and num2=15? Explain with reason.

  • برمجة
  • خوارزميات

 

What is the output of the following flowchart if my choice is 3 and num1=12 and num2=15? Explain with reason.

 

الأجوبة

What is the output of the following flowchart if my choice is 3 and num1=12 and num2=15? Explain with reason

-----------------------

Output:

180

 

Explanation:

--------------

First when the program starts list of operations will be displayed and these operation listed with numbers as :

1.Addition

2.Subtraction

3.Multiplication

4.Division

 

Then the program askes to enter a choice(a choice from the operations) and two numbers. In this case when my choice is 3 and num1=12 and num2=15. The program will check if my choice is equal to 1. Is 3 equal to 1 ? obviously no, then the program goes to the next condition and check if my choice is equal to 2. Is 3 equal to 2? no, then the program goes to the next condition and check if my choice is equal to 3. Is 3 equal to 3 ? its yes. Then the program will do multiplication operation in which result = num1*num2, result = 12*15=180. Then it will display result which contains the result of the multiplication and then program will stop.

هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...