Loop | MCQs

    Q1: Which loop is suitable to use in situations where the programmer does not know the number of time the body of the loop will be executed?

    کون سا لوپ ان حالات میں استعمال کرنے کے لئے موزوں ہے جہاں پروگرامر کو معلوم نہیں ہوتا ہے کہ لوپ کے جسم کو کس وقت کی تعداد میں پھانسی دی جائے گی؟
    • A. Nested loop
    • B. Do-while loop
    • C. None of these
    • D. For loop

    Q2: Which loop is preferred to use when the programmer knows in advance how many times the body of the loop will be executed?

    جب پروگرامر کو پہلے ہی معلوم ہوتا ہے کہ لوپ کے جسم کو کتنی بار عمل میں لایا جائے گا تو کس لوپ کو استعمال کرنے کو ترجیح دی جاتی ہے؟
    • A. Do-while
    • B. None of these
    • C. While
    • D. For

    Q3: Which statement shifts the control back to the beginning of the loop?

    کون سا بیان کنٹرول کو واپس لوپ کے آغاز پر بدل دیتا ہے؟
    • A. None of these
    • B. continue
    • C. switch
    • D. loop
    • A. None of these
    • B. break
    • C. switch
    • D. continue

    Q5: In C programming, the loop that is executed at least once (even if the condition is false) is called ______ loop.

    سی پروگرامنگ میں ، لوپ جو کم از کم ایک بار انجام دیا جاتا ہے (یہاں تک کہ اگر حالت غلط ہے) کو ______ لوپ کہا جاتا ہے۔
    • A. while
    • B. None of these
    • C. for
    • D. do-while

    Q6: Loops within loops are called _____ loops.

    لوپس کے اندر لوپ کو _____ لوپ کہا جاتا ہے۔
    • A. Conditional
    • B. None of these
    • C. Recursive
    • D. Nested

    Q7: Which loop structure is not available in C programing?

    سی پروگرامنگ میں کون سا لوپ ڈھانچہ دستیاب نہیں ہے؟
    • A. Do-while
    • B. While
    • C. Do-until
    • D. For

    Q8: What term is used to describe the activity of performing the same operation multiple times in programming?

    پروگرامنگ میں ایک ہی آپریشن کو متعدد بار انجام دینے کی سرگرمی کو بیان کرنے کے لیے کون سی اصطلاح استعمال کی جاتی ہے؟
    • A. Conditional Statement
    • B. Iteration
    • C. Function Call
    • D. Recursion

    Q9: Which type of loop is commonly used to iterate through an array in C?

    کس قسم کا لوپ عام طور پر سی میں ایک صف کے ذریعے تکرار کرنے کے لیے استعمال ہوتا ہے؟
    • A. Switch loop
    • B. If loop
    • C. While loop
    • D. For loop
    • A. Inner Loop
    • B. Double Loop
    • C. Nested Loop
    • D. Recursive Loop
✅ Correct: 0 | ❌ Wrong: 0 | 📊 Total Attempted: 0