Which loop is preferred to use when the programmer knows in advance how many times the body of the loop will be executed?
جب پروگرامر کو پہلے ہی معلوم ہوتا ہے کہ لوپ کے جسم کو کتنی بار عمل میں لایا جائے گا تو کس لوپ کو استعمال کرنے کو ترجیح دی جاتی ہے؟
- While
- For
- Do-while
- None of these
Explanation
The for loop is ideal when the number of iterations is known beforehand.
It allows initializing, testing, and updating the loop variable in a single line.
Related MCQs
ڈی ایم اے کا مطلب کیا ہے؟
- Direct Memory Access
- Direct Module Access
- Direct Memory Allocation
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ڈی او ایس کا مطلب کیا ہے؟
- Digital operating system
- Disk operation system
- Disk operating system
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
کسی مخصوص کام کو انجام دینے کے لیے کمپیوٹر کو دی گئی ہدایات کس کا مجموعہ ہے۔
- Monitor
- Hardware
- software
- Printer
اس سوال کو وضاحت کے ساتھ پڑھیں
لائٹ قلم کیا ہے؟
- Mechanical Input device
- Optical input device
- Electronic input device
- Optical output device
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ایک (1) بائٹ کس کے برابر ہے؟
- 4 bits
- 8 bits
- 12 bits
- None of these