what is the output of the given below program? if 3 + 4 == 7 print("Hi") else: print("Know Program") print("Hello") (1 Point) Hi Error Hi Hello Know Program Hello
Answers
Explanation:
if 1 + 3 == 7:
print("Hello")
else:
print("Know Program")
Know Program
The 1+3 = 4 which is not equal to 7 therefore else block will be executed.
Answer:
The output of the given program will be:
"Hi"
"Hello"
Explanation:
The program first evaluates the expression 3 + 4 == 7, which is True and this is where the code block print("Hi") is executed. Then the program moves to the next line and runs print("Hello"). The "else" block is not executed since the condition 3 + 4 == 7 is true.
In this program, we are using an if-else statement to check whether the outcome of the arithmetic operation 3 + 4 is equal to 7 or not. Here, 3+4 is equal to 7 and the if-statement evaluates to true, so the code block inside the if statement is executed and the output is "Hi". After the execution of the if-statement, the program continues to execute the next statement which is "Hello" and the output is "Hello".
More question and answers:
https://brainly.in/question/49486398
https://brainly.in/question/54813907
#SPJ3