FliQi Education App Download
प्रश्न-बैंक · C Language

For loop — प्रश्न और उत्तर

C Language · 31 जाँचे हुए (verified) प्रश्न

  • 31 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i;

    for(printf(" MyFliQi ");printf(" India ");printf(" i++ ")){

        printf(" FliQi ");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i;

    for(printf(" MyFliQi ");printf(" India ");printf(" i++ ")){

        printf(" FliQi ");

    }

    return 0;

}
  1. Aकंपाइल टाइम एररCompile Time Error
  2. Bपहले MyFliQi, फिर India FliQi i++ 5 बारMyFliQi then India FliQi i++ 5 times
  3. Cपहले MyFliQi, फिर India FliQi i++ अनंत बारMyFliQi then India FliQi i++ Infinite times
  4. DMyFliQi FliQI India i++

सही उत्तर / Answer: (C)

हल / Solution
for के शीर्ष के किसी भी भाग में function call हो सकता है। पहला printf एक बार MyFliQi छापता है। शर्त India वाला printf है, और printf छपे हुए अक्षरों की संख्या लौटाता है, यहाँ 7। 7 शून्य नहीं है, इसलिए शर्त हमेशा सत्य है। इसलिए MyFliQi के बाद India, FliQi, i++ का क्रम लगातार दोहराता है। i++ बस उद्धरण में लिखा पाठ है, वह कुछ नहीं बदलता।
Any function call can be a part of a for header. The init printf prints MyFliQi once. The condition is the printf of India, and printf returns the number of characters it printed, here 7. Since 7 is non-zero, the test is always true. So after MyFliQi, the pattern India, FliQi, i++ repeats forever. The i++ is only text inside quotes and changes nothing. The code compiles fine.
प्रश्न 2उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 400;

    for(; i ; i>>=2){

        printf("FliQi");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 400;

    for(; i ; i>>=2){

        printf("FliQi");

    }

    return 0;

}
  1. AFliQi 400 बार छपेगाFliQi Will be printed 400 times
  2. BFliQi 100 बार छपेगाFliQi Will be printed 100 times
  3. CFliQi 10 बार छपेगाFliQi Will be printed 10 times
  4. DFliQi 5 बार छपेगाFliQi Will be printed 5 times

सही उत्तर / Answer: (D)

हल / Solution
i >>= 2 से i दो bit दाईं ओर खिसकता है, यानी 4 से भाग होता है और शेष छूट जाता है। मान होंगे 400, 100, 25, 6 और 1। ये सब शून्य नहीं हैं, इसलिए हर एक पर FliQi छपता है, यानी 5 बार। फिर 1 >> 2 से 0 बनता है, शर्त i असत्य हो जाती है और लूप रुकता है। विकल्प 1, 2 और 3 मान लेते हैं कि लूप 400, 100 या 10 बार चलेगा।
i >>= 2 shifts i right by two bits, which is the same as dividing by 4 and dropping the remainder. The values are 400, 100, 25, 6 and 1. Each of them is non-zero, so FliQi is printed for each: 5 times. Next, 1 >> 2 gives 0, the test i becomes false and the loop stops. Options 1, 2 and 3 assume the loop runs 400, 100 or 10 times.
प्रश्न 3उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(i = 10;i>=20;i++){

        printf(" FliQi ");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(i = 10;i>=20;i++){

        printf(" FliQi ");

    }

    return 0;

}
  1. AFliQI 10 बार छपेगाFliQI will be printed 10 Times
  2. BFliQI 11 बार छपेगाFliQI will be printed 11 Times
  3. CFliQI अनंत बार छपेगाFliQI will be printed Infinite Times
  4. DFliQI 0 बार छपेगाFliQI will be printed 0 Times

सही उत्तर / Answer: (D)

हल / Solution
पहला भाग i = 10 करता है। फिर पहले चक्कर से पहले ही शर्त i >= 20 जाँची जाती है। 10 न 20 से बड़ा है, न बराबर, इसलिए शर्त शुरू में ही असत्य है। body एक बार भी नहीं चलती, इसलिए FliQi 0 बार छपता है। लूप अनंत नहीं हो सकता, क्योंकि वह शुरू ही नहीं होता। 10 या 11 बार छपने के लिए शुरुआत में शर्त सत्य होनी चाहिए।
The init part sets i = 10, and then the condition i >= 20 is checked before the first pass. 10 is not greater than or equal to 20, so the condition is false right away. The body never runs, so FliQi is printed 0 times. The loop cannot become infinite, because it never even starts. Counts like 10 or 11 would need the test to be true at the beginning.
प्रश्न 4उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i, j, n = 50;

    for(i = 0, j = 0; i<3, j<=n; j+=5){

        printf("FliQi");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i, j, n = 50;

    for(i = 0, j = 0; i<3, j<=n; j+=5){

        printf("FliQi");

    }

    return 0;

}
  1. AFliQi 3 बार छपेगाFliQi will be printed 3 times
  2. BFliQi 50 बार छपेगाFliQi will be printed 50 times
  3. CFliQi 10 बार छपेगाFliQi will be printed 10 Times
  4. DFliQI 11 बार छपेगाFliQI will be printed 11 Times

सही उत्तर / Answer: (D)

हल / Solution
शर्त i<3, j<=n में comma ऑपरेटर लगा है। यह दोनों भाग चलाता है, पर मान सिर्फ़ दाएँ भाग का रखता है। इसलिए लूप सिर्फ़ j <= n से तय होता है, i का कोई असर नहीं। j के मान 0, 5, 10, ... 50 होंगे, यानी 50/5 + 1 = 11 मान। j = 55 पर शर्त असत्य हो जाती है। इसलिए FliQi 11 बार छपता है, न 3, न 10, न 50 बार।
The condition i<3, j<=n uses the comma operator. It evaluates both parts but keeps only the value of the right one, so only j <= n decides the loop. i stays 0 and does not matter. j takes the values 0, 5, 10, ... 50, which is 11 values, since 50/5 + 1 = 11. At j = 55 the test fails. So FliQi is printed 11 times, not 3, 10 or 50 times.
प्रश्न 5उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(printf("MyFliQi ");i<=5;i++){

        printf(" FliQi ");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(printf("MyFliQi ");i<=5;i++){

        printf(" FliQi ");

    }

    return 0;

}
  1. AMyFliQi
  2. BMyFliQi FliQi
  3. CFliQi 5 बारFliQi 5 Times
  4. Dपहले MyFliQI, फिर FliQi 5 बारMyFliQI then FliQi 5 times

सही उत्तर / Answer: (D)

हल / Solution
for लूप का पहला भाग सिर्फ़ एक बार चलता है। यहाँ वह printf है, इसलिए शुरुआत में MyFliQi एक बार छपता है। फिर i, 1 से 5 तक चलता है और हर चक्कर में body FliQi छापती है। i = 6 होते ही शर्त i <= 5 असत्य होती है और लूप रुकता है। इसलिए आउटपुट: पहले MyFliQi एक बार, फिर FliQi पाँच बार। विकल्प 1, 2 और 3 में कुछ छपाई छूट जाती है।
The init part of a for loop runs only once. Here it is a printf, so MyFliQi is printed one time at the start. Then i goes from 1 to 5, and in each pass the body prints FliQi. When i becomes 6, the test i <= 5 fails and the loop ends. So the output is MyFliQi once, followed by FliQi five times. Options 1, 2 and 3 miss some of these prints.
प्रश्न 6उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1, n = 5;

    for(i = 1;i<=5;i++){

        printf("%d ",i*n);

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1, n = 5;

    for(i = 1;i<=5;i++){

        printf("%d ",i*n);

    }

    return 0;

}
  1. A5 10 15 20 25
  2. B1 2 3 4 5
  3. C1*5 2*5 3*5 4*5 5*5
  4. Dइनमें से कोई नहींNone of the above

सही उत्तर / Answer: (A)

हल / Solution
लूप i = 1 से 5 तक चलता है और n = 5 है। printf, i*n का मान छापता है, उसका पाठ नहीं। इसलिए 1*5 = 5, 2*5 = 10, 3*5 = 15, 4*5 = 20 और 5*5 = 25 छपते हैं, हर एक के बाद एक space। आउटपुट 5 10 15 20 25 है। विकल्प 2 सिर्फ़ i छापता, और विकल्प 3 गुणा को पाठ की तरह दिखाता है, जो ग़लत है।
The loop runs for i = 1 to 5, and n is 5. printf prints the value of the expression i*n, not its text. So it prints 1*5 = 5, 2*5 = 10, 3*5 = 15, 4*5 = 20 and 5*5 = 25, each followed by a space. The output is 5 10 15 20 25. Option 2 would print only i, and option 3 wrongly shows the multiplication as text.
प्रश्न 7उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(i = 1;i<=10;i++){

        if(i%2==0)

            printf("%d ",i);

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(i = 1;i<=10;i++){

        if(i%2==0)

            printf("%d ",i);

    }

    return 0;

}
  1. A1 3 5 7 9
  2. B2 4 6 8 10
  3. Cअनंत लूपInfinite Loop
  4. Dकुछ नहीं छपेगाPrint Nothing

सही उत्तर / Answer: (B)

हल / Solution
लूप i = 1 से 10 तक चलता है। अंदर i % 2 == 0 तभी सत्य है जब i, 2 से पूरा बँटे, यानी सम संख्या हो। इसलिए printf सिर्फ़ 2, 4, 6, 8 और 10 के लिए चलता है। विषम संख्याएँ 1, 3, 5, 7, 9 छोड़ दी जाती हैं। i = 10 के बाद i++ से 11 होता है और लूप रुक जाता है। इसलिए आउटपुट 2 4 6 8 10 है, न अनंत लूप, न ख़ाली।
The loop runs for i = 1 to 10. Inside, i % 2 == 0 is true only when i is divisible by 2, that is, for even numbers. So printf runs only for 2, 4, 6, 8 and 10, each followed by a space. The odd numbers 1, 3, 5, 7 and 9 are skipped. After i = 10, i++ makes it 11 and the loop ends. So the output is 2 4 6 8 10.
प्रश्न 8उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(i = 1;i<=10;i+2){

        printf("FliQi ");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(i = 1;i<=10;i+2){

        printf("FliQi ");

    }

    return 0;

}
  1. AFliQi 10 बार छपेगाFliQi will be printed 10 times
  2. BFliQi 5 बार छपेगाFliQi will be printed 5 times
  3. CFliQi अनंत बार छपेगाFliQi will be printed Infinite times
  4. Dकुछ नहीं छपेगाPrint Nothing

सही उत्तर / Answer: (C)

हल / Solution
update भाग i+2 है। यह बस एक मान निकालता है, पर उसे i में वापस नहीं रखता। इसलिए i हमेशा 1 ही रहता है। i में 2 जोड़ने के लिए i += 2 लिखना पड़ता। i नहीं बदलता, तो शर्त i <= 10 हमेशा सत्य रहती है और FliQi लगातार छपता है। i += 2 होता तो 5 बार छपता, विकल्प 2 यही जाल है। 10 बार या कुछ न छपना भी ग़लत है।
The update part is i+2. It calculates a value but does not store it back in i, so i stays 1. To add 2 to i we need i += 2 or i = i + 2. Since i never changes, the test i <= 10 is always true and FliQi is printed forever. With i += 2 it would print 5 times, which is the trap in option 2. It is not 10 times or zero times either.
प्रश्न 9उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(;5;){

        printf("FliQi ");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(;5;){

        printf("FliQi ");

    }

    return 0;

}
  1. AFliQi 0 बार छपेगाFliQi will be printed 0 times
  2. BFliQi 5 बार छपेगाFliQi will be printed 5 times
  3. CFliQi अनंत बार छपेगाFliQi will be printed Infinite times
  4. Dकंपाइल टाइम एररCompile Time Error

सही उत्तर / Answer: (C)

हल / Solution
C में शून्य के अलावा हर मान सत्य माना जाता है। यहाँ शर्त स्थिर मान 5 है, जो शून्य नहीं है, इसलिए हमेशा सत्य है। लूप में ऐसा कुछ नहीं जो इसे बदले, और break भी नहीं है। इसलिए FliQi बिना रुके छपता रहता है। यहाँ 5 का मतलब पाँच बार नहीं है, वह बस एक सत्य मान है। कोड सही है, इसलिए compile error नहीं।
In C, any non-zero value counts as true. The condition here is the constant 5, which is non-zero, so it is always true. Nothing in the loop can change a constant, and there is no break. So FliQi is printed again and again without end. The number 5 does not mean five times; it is only a true value. The code is valid, so there is no compile error.
प्रश्न 10उत्तर + हल
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(printf("MyFliQi ");i<=5;printf(" FliQi ")){

       printf(" FliQi ");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(printf("MyFliQi ");i<=5;printf(" FliQi ")){

       printf(" FliQi ");

    }

    return 0;

}
  1. AMyFliQi FliQi FliQi
  2. Bपहले MyFliQi, फिर FliQi अनंत बारMyFliQi then FliQi Infinite times
  3. Cपहले MyFliQi, फिर FliQi 5 बारMyFliQi then FliQi will be printed 5 times
  4. Dकंपाइल टाइम एररCompile Time Error

सही उत्तर / Answer: (B)

हल / Solution
पहला भाग, यानी MyFliQi वाला printf, सिर्फ़ एक बार शुरुआत में चलता है। फिर शर्त i <= 5 जाँची जाती है। i = 1 है और उसे कोई नहीं बदलता, क्योंकि body और update दोनों बस FliQi छापते हैं। इसलिए शर्त हमेशा सत्य है और FliQi बार-बार छपता है। आउटपुट: पहले MyFliQi एक बार, फिर FliQi अनंत बार। यह 5 बार पर नहीं रुकता और कोड ठीक से compile होता है।
The init part, the printf of MyFliQi, runs only once at the start. After that the test i <= 5 is checked. i is 1 and nothing changes it, because both the body and the update only print FliQi. So the test is always true and FliQi is printed again and again. The output is MyFliQi once, then FliQi forever. It does not stop after 5 times, and the code compiles fine.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(;i<=5;i++){

        i++; 

    printf("%d ",i);

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(;i<=5;i++){

        i++; 

    printf("%d ",i);

    }

    return 0;

}
  1. A1 2 3 4 5
  2. B2 4 6
  3. C1 3 5
  4. Dअनंत लूपInfinite Loop
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 12उत्तर app में
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    int i = 1;

    for(;i<=5;){

        printf("FliQi");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    int i = 1;

    for(;i<=5;){

        printf("FliQi");

    }

    return 0;

}
  1. AFliQi
  2. BFliQi FliQI FliQI FLiQI FliQI
  3. Cअनंत लूपInfinite Loop
  4. Dकंपाइल टाइम एररCompile Time Error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
आउटपुट ज्ञात कीजिए

#include <stdio.h>

int main() {

    for(;;){

        printf("FliQi");

    }

    return 0;

}
Find the Output

#include <stdio.h>

int main() {

    for(;;){

        printf("FliQi");

    }

    return 0;

}
  1. AFliQi
  2. Bअनंत लूपInfinite Loop
  3. Cकुछ नहीं छपेगाPrint Nothing
  4. Dकंपाइल टाइम एररCompile Time Error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main() {

    for(){

        printf("FliQi");

    }

    return 0;

}
What will be the output of the following C program?

#include <stdio.h>

int main() {

    for(){

        printf("FliQi");

    }

    return 0;

}
  1. AFliQi
  2. Bअनंत लूपInfinite Loop
  3. Cकुछ नहीं छपेगाPrint Nothing
  4. Dकंपाइल टाइम एररCompile Time Error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
आउटपुट क्या है?

#include<stdio.h>

int main()

{

   int n;

   for (n = 9; n!=0; n--)

     printf("n = %d", n--);

   return 0;

}
What is the output?

#include<stdio.h>

int main()

{

   int n;

   for (n = 9; n!=0; n--)

     printf("n = %d", n--);

   return 0;

}
  1. A9 7 5 3 1
  2. B9 8 7 6 5 4 3 2 1
  3. Cअनंत लूप (Infinite Loop)Infinite Loop
  4. D9 7 5 3
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
निम्नलिखित प्रोग्राम में FliQi कितनी बार छपेगा?

#include <stdio.h>

int main()

{

    int i = 1024;

    for (; i; i >>= 1)

        printf("FliQi");

    return 0;

}
How many times will FliQi be printed by the following program?

#include <stdio.h>

int main()

{

    int i = 1024;

    for (; i; i >>= 1)

        printf("FliQi");

    return 0;

}
  1. A10
  2. B11
  3. Cअनंत बारInfinite
  4. Dप्रोग्राम कंपाइल टाइम एरर देगाThe program will show compile-time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
दिए गए प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

   int i;

   for (;;)

   {

      printf("Know Program");

      break;

   }

   return 0;

}
Find the output of the given program.

#include<stdio.h>

int main()

{

   int i;

   for (;;)

   {

      printf("Know Program");

      break;

   }

   return 0;

}
  1. AKnow Program
  2. BKnow Program अनंत बार छपेगा।Know Program is printed infinite times.
  3. Cकंपाइल हो जाएगा, पर कोई आउटपुट नहींCompiled Successfully, No Output
  4. Dकंपाइल टाइम एररCompile-time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int i = 0;

    for (i++; i == 1; i = 2)

        printf("In for loop ");

        printf("After loop\n");

}
What will be the output of the following C code?

#include <stdio.h>

int main(){

    int i = 0;

    for (i++; i == 1; i = 2)

        printf("In for loop ");

        printf("After loop\n");

}
  1. AIn for loop after loop
  2. BAfter loop
  3. Cकंपाइल टाइम एररCompile time error
  4. Dअपरिभाषित व्यवहार (Undefined behaviour)Undefined behaviour
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main()

{

    int i = 0;

    for (; ; ;)

        printf("In for loop\n");

        printf("After loop\n");

}
What will be the output of the following C code?

#include <stdio.h>

int main()

{

    int i = 0;

    for (; ; ;)

        printf("In for loop\n");

        printf("After loop\n");

}
  1. Aकंपाइल टाइम एररCompile time error
  2. Bअनंत लूपInfinite loop
  3. CAfter loop
  4. Dअपरिभाषित व्यवहार (Undefined behaviour)Undefined behaviour
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

void main()

{

    int k;

    for (k = -3; k < -5; k++)

       printf("Hello");

}
What will be the output of the following C code?

#include <stdio.h>

void main()

{

    int k;

    for (k = -3; k < -5; k++)

       printf("Hello");

}
  1. AHello
  2. Bअनंत बार HelloInfinite hello
  3. Cरनटाइम एररRun time error
  4. Dकुछ नहींNothing
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

void main(){

    double k = 0;

    for (k = 0.0; k < 3.0; k++);

        printf("%lf", k);

}
What will be the output of the following C code?

#include <stdio.h>

void main(){

    double k = 0;

    for (k = 0.0; k < 3.0; k++);

        printf("%lf", k);

}
  1. A2.000000
  2. B4.000000
  3. C3.000000
  4. Dरनटाइम एररRun time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

void main()

{

    double k = 0;

    for (k = 0.0; k < 3.0; k++)

        printf("Hello");

}
What will be the output of the following C code?

#include <stdio.h>

void main()

{

    double k = 0;

    for (k = 0.0; k < 3.0; k++)

        printf("Hello");

}
  1. Aरनटाइम एररRun time error
  2. BHello तीन बार छपेगाHello is printed thrice
  3. CHello दो बार छपेगाHello is printed twice
  4. DHello अनंत बार छपेगाHello is printed infinitely
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

void main()

{

    int k = 0;

    for (k)

        printf("Hello");

}
What will be the output of the following C code?

#include <stdio.h>

void main()

{

    int k = 0;

    for (k)

        printf("Hello");

}
  1. Aकंपाइल टाइम एररCompile time error
  2. Bhello
  3. Cकुछ नहींNothing
  4. Dबदलता रहता हैVaries
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main()

{

    short i;

    for (i = 1; i >= 0; i++)

        printf("%d\n", i);

}
What will be the output of the following C code?

#include <stdio.h>

int main()

{

    short i;

    for (i = 1; i >= 0; i++)

        printf("%d\n", i);

}
  1. Aनियंत्रण for लूप में जाएगा ही नहींThe control won't fall into the for loop
  2. Bshort की signed सीमा तक संख्याएँ छपेंगी और फिर runtime error आएगाNumbers will be displayed until the signed limit of short and throw a runtime error
  3. Cshort की signed सीमा तक संख्याएँ छपेंगी और प्रोग्राम ठीक से समाप्त हो जाएगाNumbers will be displayed until the signed limit of short and program will successfully terminate
  4. Dप्रोग्राम infinite loop में फँसकर बिना error के संख्याएँ छापता रहेगाThis program will get into an infinite loop and keep printing numbers with no errors
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
कौन-सा for लूप, for (i = 0; i < n; i++) में प्रयुक्त 'i' के समान इंडेक्स की रेंज चलाता है?
Which for loop covers the same range of index values of 'i' as for (i = 0; i < n; i++)?
  1. Afor (i = n; i>0; i--)
  2. Bfor (i = n; i >= 0; i--)
  3. Cfor (i = n-1; i>0; i--)
  4. Dfor (i = n-1; i>-1; i--)
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 27उत्तर app में
एक ही for लूप में दो वेरिएबल एक साथ चलाने का सही सिंटैक्स कौन-सा है?
What is the correct syntax for running a for loop with two variables simultaneously?
  1. Afor (i = 0; i < n; i++)

    for (j = 0; j < n; j += 5)
  2. Bfor (i = 0, j = 0; i < n, j < n; i++, j += 5)
  3. Cfor (i = 0; i < n;i++){}

    for (j = 0; j < n;j += 5){}
  4. Dइनमें से कोई नहींnone of the mentioned
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 28उत्तर app में
for लूप के बारे में निम्नलिखित में से कौन-सी टिप्पणियाँ सही हैं?
Which of the following comments about the for loop are correct?
  1. Abreak का उपयोग उस goto के बराबर है जो लूप के ठीक बाद वाले कथन पर कूदता हैUsing break is equivalent to using a goto that jumps to the statement immediately following the loop
  2. Bcontinue का उपयोग लूप के मौजूदा चक्कर का बचा हिस्सा छोड़ने के लिए होता हैcontinue is used to bypass the remainder of the current pass of the loop
  3. Ccomma ऑपरेटर लगाने पर लौटाया गया मान दाएँ operand का मान होता हैif comma operator is used, then the value returned is the value of the right operand
  4. Dये सभीall of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 30उत्तर app में
for लूप के बारे में निम्नलिखित में से कौन-सा कथन सत्य है?
Which of the following statements about the for loop is true?
  1. Aलूप के बाहर भी इंडेक्स का मान बना रहता हैThe index value is retained outside the loop
  2. Bलूप के अंदर से इंडेक्स का मान बदला जा सकता हैThe index value can be changed from within the loop
  3. Cलूप से बाहर कूदने के लिए goto का उपयोग किया जा सकता हैgoto can be used to jump out of the loop
  4. Dये सभीall of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
For loop के सभी 31 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

C Language के दूसरे topics

सभी topics