Question 12 - Week 5 Practice | Prasnya
Prasnya
Continue with Google
Practice path
Dashboard
Exam
Qualifier / Quiz 1
Go to subject
Programing with python
Go to chapter
Week 5
Question 12
00:00
Est. 2 min
Marks:
+3.00
0.00
If `n` is a positive integer, what is the value of `count` at the end of execution of the code given below? ``` n = int(input()) count = 0 for x in range(1, n + 1): for y in range(x + 1, n + 1): count = count + 1 ```
Single correct
Medium Difficulty
05 June 2022
A
n
2
n^2
B
n
(
n
+
1
)
n(n + 1)
C
n
(
n
+
1
)
2
\frac{n(n + 1)}{2}
D
n
(
n
−
1
)
2
\frac{n(n - 1)}{2}