NIELIT O Level Exam

<p>How many numbers will be printed by the following code?</p><pre>def fun(a,b):<br>&nbsp; &nbsp; for x in range(a,b+1):<br>&nbsp; &nbsp; &nbsp; &nbsp; if x%3==0:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(x,end=" ")<br>fun(100,120)</pre>

How many numbers will be printed by the following code?

def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x,end=" ")
fun(100,120)


निम्नलिखित कोड से कितनी संख्याएँ प्रिंट होंगी?

def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x,end=" ")
fun(100,120)

A. 7

B. 8

C. 6

D. 9




Correct Answer is :

A. 7



Explanation

The output is:

102 105 108 111 114 117 120 

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad