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

If Else Statement in C Language — प्रश्न और उत्तर

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

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

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

भाषा
प्रश्न 1उत्तर + हल
नीचे दिए गए प्रोग्राम का आउटपुट बताइए।

#include <stdio.h>

int main()

{

    int i;

    if (printf("0"))

        i = 3;

    else

        i = 5;

    printf("%d", i);

    return 0;

}
Predict the output of the program given below.

#include <stdio.h>

int main()

{

    int i;

    if (printf("0"))

        i = 3;

    else

        i = 5;

    printf("%d", i);

    return 0;

}
  1. A3
  2. B5
  3. C03
  4. D05

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

हल / Solution
printf पहले अपना छापने का काम करता है और फिर छपे अक्षरों की गिनती लौटाता है। यहाँ वह एक अक्षर शून्य छापता है और 1 लौटाता है, इसलिए पर्दे पर पहला अक्षर शून्य आ जाता है। लौटा हुआ 1 शून्य नहीं है, सो शर्त सत्य है और i को 3 मिलता है। अंत में दूसरा printf वही 3 छापता है। दोनों हिस्से मिलकर आउटपुट 03 बनाते हैं; 5 तभी आता जब printf शून्य लौटाता।
printf does its printing first and then returns the count of characters written. Here it prints the single character zero and returns 1, so a zero already appears on the screen. The returned 1 is non zero, so the condition is true and i receives 3. At the end the second printf prints that 3. The two parts together give the output 03.
प्रश्न 2उत्तर + हल
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=5, b=7;

    if(5<a){

        printf("Delhi");

    }

    printf("Gurugram");

    if(3<b)

              printf("Banglore");

    else

              printf("Chennai");

    else

              printf("Jaipur");

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

#include <stdio.h>

int main(){

    int a=5, b=7;

    if(5<a){

        printf("Delhi");

    }

    printf("Gurugram");

    if(3<b)

              printf("Banglore");

    else

              printf("Chennai");

    else

              printf("Jaipur");

}
  1. ADelhiGurugramBanglore
  2. BDelhiGurugram
  3. CJaipur
  4. DCompile Time Error

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

हल / Solution
तीसरी शर्त के साथ एक else पहले से जुड़ चुका है, जो Chennai छापता। उसके बाद एक और else लिखा गया है, पर उसके लिए कोई बिना-else वाला if बचा ही नहीं — ऊपर का पहला if अपने कोष्ठक के साथ कभी पहले ही पूरा हो गया था। बिना if वाला else संकलक (compiler) की ग़लती है, सो संकलन वहीं रुक जाता है। चूँकि प्रोग्राम बनता ही नहीं, Delhi या Gurugram छपने का सवाल नहीं उठता।
The third condition already has one else attached to it, the one that would print Chennai. After that a second else is written, but no if without an else is left for it, because the first if above was completed long before with its own closing brace. An else with no matching if is a compile error, so compilation stops at that point. Since no program is built, neither Delhi nor Gurugram can be printed at all.
प्रश्न 3उत्तर + हल
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=5, b=7;

    if(a<b)

              if(0)

            printf("FliQi");

        else

            printf("Mera BHARAT");

         else

            printf("Mera TIRANGA, Meri SHAAN");

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

#include <stdio.h>

int main(){

    int a=5, b=7;

    if(a<b)

              if(0)

            printf("FliQi");

        else

            printf("Mera BHARAT");

         else

            printf("Mera TIRANGA, Meri SHAAN");

}
  1. AFliQi
  2. BMera BHARAT
  3. CMera TIRANGA, Meri SHAAN
  4. DMera BharatMera TIRANGA, Meri SHAAN

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

हल / Solution
कोष्ठक न होने पर else सबसे पास वाले, बिना else वाले if से जुड़ता है। इसलिए पहला else भीतरी शर्त का है और दूसरा else बाहरी शर्त का। a का b से छोटा होना सत्य है, सो नियंत्रण भीतर जाता है; वहाँ शर्त शून्य यानी असत्य है, इसलिए उसी का else चलकर Mera BHARAT छापता है। बाहरी शर्त सत्य थी, सो उसका else छूट जाता है और तिरंगे वाला संदेश नहीं छपता। दोनों एक साथ कभी नहीं आ सकते।
Without braces an else joins the nearest if that does not have one yet. So the first else belongs to the inner condition and the second else to the outer one. Since a is smaller than b, control enters the inner if, whose condition is zero and therefore false, so its else runs and prints Mera BHARAT. The outer condition was true, so its own else is skipped and the tiranga message is not printed. Both can never appear together.
प्रश्न 4उत्तर + हल
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=5, b=7;

      if(a>b){

        if(1){

                       printf("FliQi");

               }

       }

               else{

                   printf("My FliQi");

               }

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

#include <stdio.h>

int main(){

    int a=5, b=7;

      if(a>b){

        if(1){

                       printf("FliQi");

               }

       }

               else{

                   printf("My FliQi");

               }

}
  1. AFliQi
  2. BMy FliQi
  3. CPrint Nothing
  4. DCompile Time Error

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

हल / Solution
यहाँ कोष्ठक साफ़-साफ़ लगे हैं, इसलिए else बाहरी if का ही है, भीतरी if का नहीं। a 5 और b 7 है, सो बाहरी शर्त असत्य निकलती है और भीतर का वह भाग, जिसमें FliQi छपता, चलता ही नहीं। नियंत्रण सीधे else वाले ब्लॉक में जाता है और My FliQi छपता है। कुछ न छपना तब होता जब else ही न होता, और कोड पूरी तरह वैध है, इसलिए कम्पाइल टाइम एरर भी नहीं आता।
The braces here are explicit, so the else belongs to the outer if and not to the inner one. With a as 5 and b as 7 the outer test is false, so the inner block that would print FliQi never runs. Control moves straight into the else block and My FliQi is printed. The code is entirely valid, so no compile time error arises.
प्रश्न 5उत्तर + हल
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=5, b=7;

      if(a>b)

          if(1)

                    printf("FliQi");

       else

                   printf("FliQi Education");

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

#include <stdio.h>

int main(){

    int a=5, b=7;

      if(a>b)

          if(1)

                    printf("FliQi");

       else

                   printf("FliQi Education");

}
  1. AFliQi
  2. BFliQi Education
  3. CPrint Nothing
  4. DCompile Time Error

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

हल / Solution
यहाँ कोष्ठक नहीं हैं, इसलिए लटकते else (dangling else) के नियम से else भीतरी if के साथ जुड़ता है, बाहरी if के साथ नहीं। a 5 और b 7 है, सो बाहरी शर्त असत्य है और उसके अधीन पड़ा पूरा भीतरी if-else ढाँचा एक ही कथन की तरह छूट जाता है। नतीजा यह कि कुछ भी नहीं छपता। FliQi Education पाने के लिए बाहरी if को { } में बाँधना पड़ता, तभी else उसका होता और असत्य शर्त पर चलता।
There are no braces here, so by the dangling else rule the else attaches to the inner if and not to the outer one. With a as 5 and b as 7 the outer test is false, and the whole inner if-else structure, a single statement under it, is skipped together. Nothing is printed at all. To get FliQi Education the outer if would need braces.
प्रश्न 6उत्तर + हल
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=5, b=7;

    if(a<b){

        printf("Jaipur");

        if(!3){

                   printf("Delhi");

        }

        if(!17<10){

                   printf("Mumbai");

        }         

    }

    printf("Vandey Matram");

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

#include <stdio.h>

int main(){

    int a=5, b=7;

    if(a<b){

        printf("Jaipur");

        if(!3){

                   printf("Delhi");

        }

        if(!17<10){

                   printf("Mumbai");

        }         

    }

    printf("Vandey Matram");

}
  1. AVandey Matram
  2. BJaipurDelhiVandey Matram
  3. CJaipurMumbaiVandey Matram
  4. DDelhiMumbaiVandey Matram

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

हल / Solution
a का b से छोटा होना सत्य है, सो Jaipur छपता है। इसके बाद 3 सत्य है, इसलिए उसका उलटा शून्य हुआ और Delhi छूट गया। अब तीसरी शर्त ध्यान से देखिए — ! की प्राथमिकता (precedence) < से ऊँची है, इसलिए पहले 17 का उलटा शून्य बनता है और फिर शून्य का 10 से छोटा होना जाँचा जाता है, जो सत्य है; इसी से Mumbai छपता है। अंत में ब्लॉक के बाहर वाला printf हर हाल में चलता है।
The test that a is smaller than b is true, so Jaipur is printed. Next, 3 is true, so its negation is zero and Delhi is skipped. Now look carefully at the third condition: the ! operator has higher precedence than <, so 17 is negated to zero first and then zero is compared with 10, which is true, and Mumbai is printed. Finally the printf outside the block always runs, giving JaipurMumbaiVandey Matram as the whole output.
प्रश्न 7उत्तर + हल
निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=5, b=7;

      if(a>b);

            printf("FliQi");

       if(10)

                  printf("Jai Hind");

       else

            printf("FliQi Education");

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

#include <stdio.h>

int main(){

    int a=5, b=7;

      if(a>b);

            printf("FliQi");

       if(10)

                  printf("Jai Hind");

       else

            printf("FliQi Education");

}
  1. AJai Hind
  2. BFliQi
  3. CFliQi Jai Hind
  4. DFliQi FliQi Education

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

हल / Solution
if(a>b); में अर्धविराम (semicolon) ही उसका खाली कथन (empty statement) बन जाता है, इसलिए शर्त असत्य होने पर भी आगे वाला printf उसके अधीन नहीं रहता और FliQi हर हाल में छपता है। इसके बाद if(10) में 10 शून्य नहीं है, सो शर्त सत्य है और Jai Hind छपता है, else छूट जाता है। दोनों मिलकर पूरा आउटपुट बनता है। असली सबक़ यह है कि if के आगे रखा अर्धविराम बड़ी और चुपचाप बैठी चूक है।
In if(a>b); the semicolon itself becomes the empty statement controlled by the if, so the printf that follows is no longer under that condition and FliQi is printed whatever the values are. Next, in if(10) the value 10 is non zero, so the condition is true, Jai Hind is printed and the else is skipped. The two together make the full output. The real lesson is that a stray semicolon after if is a serious and silent mistake.
प्रश्न 8उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main()

{

    int a=10;

    if(10L == a)

        printf("10L");

    else if(10==a)

        printf("10");

    else

        printf("0");

    return 0;

}
What will be the output of the following program?

#include <stdio.h>

int main()

{

    int a=10;

    if(10L == a)

        printf("10L");

    else if(10==a)

        printf("10");

    else

        printf("0");

    return 0;

}
  1. A10
  2. B10L
  3. C10L10
  4. DERROR

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

हल / Solution
10L एक long स्थिरांक (constant) है, पर तुलना से पहले C दोनों पक्षों को एक ही टाइप में ले आता है — इसे सामान्य अंकगणितीय रूपांतरण (usual arithmetic conversion) कहते हैं। a का मान 10 long बनकर 10L के बराबर निकलता है, सो पहली शर्त ही सत्य है और उसी का printf चलता है। if-else की शृंखला में पहली सत्य शर्त के बाद बाक़ी जाँचें छूट जाती हैं।
10L is a long constant, but before comparing, C brings both sides to one common type through the usual arithmetic conversions. The value 10 held in a becomes a long and matches 10L, so the very first condition is true and its printf runs. In an if-else chain the remaining tests are skipped once a condition succeeds, so 10 is never printed and the two outputs can never appear together. The code is valid, so there is no error.
प्रश्न 9उत्तर + हल
निम्नलिखित में से कौन-से कथन ग़लत हैं? यदि int a=10 हो:

1)  if( a==10 )   printf("IncludeHelp");

2)  if( 10==a )   printf("IncludeHelp");

3)  if( a=10  )   printf("IncludeHelp");

4)  if( 10=a  )   printf("IncludeHelp");
Which of the following are incorrect statements, if int a=10?

1)  if( a==10 )   printf("IncludeHelp");

2)  if( 10==a )   printf("IncludeHelp");

3)  if( a=10  )   printf("IncludeHelp");

4)  if( 10=a  )   printf("IncludeHelp");
  1. A3 and 4
  2. B3 only
  3. C4 only
  4. D2,3 and 4

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

हल / Solution
कथन 1 और 2 दोनों ठीक हैं; a==10 और 10==a एक ही तुलना हैं, और दूसरा रूप तो भूल से एक बराबर लिखने से बचा लेता है। कथन 3 भी वैध C है — वहाँ a को 10 दिया जाता है और वही मान शर्त बन जाता है; संकलक चेतावनी दे सकता है, पर यह ग़लती नहीं। कथन 4 में बाईं ओर स्थिरांक 10 है, जबकि वहाँ बदला जा सकने वाला चर (lvalue) चाहिए। इसलिए केवल कथन 4 ग़लत है।
Statements 1 and 2 are both fine, because a==10 and 10==a are the same comparison, and the second form even guards against typing a single equals sign by mistake. Statement 3 is valid C too: it assigns 10 to a and uses that value as the condition, and a compiler may warn but this is not an error. Statement 4 puts the constant 10 on the left, where a modifiable variable is needed. So only statement 4 is incorrect.
प्रश्न 10उत्तर + हल
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main()

{

    int pn=100;

    if(pn>20)

        if(pn<20)

            printf("Heyyyyy");

    else

        printf("Hiiiii");

    return 0;

}
What will be the output of the following program?

#include <stdio.h>

int main()

{

    int pn=100;

    if(pn>20)

        if(pn<20)

            printf("Heyyyyy");

    else

        printf("Hiiiii");

    return 0;

}
  1. ANo output
  2. BHiiiii
  3. CHeyyyyy
  4. DHeyyyyyHiiiii

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

हल / Solution
यह लटकते else (dangling else) का प्रश्न है। C का नियम है कि else सबसे पास वाले, बिना else वाले if से जुड़ता है — इंडेंट (indent) से कुछ तय नहीं होता। इसलिए यहाँ else भीतरी if का है, बाहरी का नहीं। pn 100 है, सो बाहरी शर्त सत्य है और नियंत्रण भीतर पहुँचता है; वहाँ pn का 20 से छोटा होना असत्य है, इसलिए उसी का else चलकर Hiiiii छापता है।
This is the dangling else problem. The rule in C is that an else joins the nearest preceding if that does not already have one, and indentation decides nothing. So the else here belongs to the inner if and not to the outer one. Since pn is 100 the outer test is true and control enters the inner if, where the inner test is false, so its else prints Hiiiii.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

#define TRUE 1

int main()

{

    if(TRUE)

        printf("1");

        printf("2");

    else

        printf("3");

        printf("4");

    return 0;

}
What will be the output of the following program?

#include <stdio.h>

#define TRUE 1

int main()

{

    if(TRUE)

        printf("1");

        printf("2");

    else

        printf("3");

        printf("4");

    return 0;

}
  1. AERROR
  2. B1
  3. C12
  4. D2
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 12उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main()

{

    if( (-100 && 100)||(20 && -20) )

        printf("Condition is true.");

    else

        printf("Condition is false.");

    return 0;

}
What will be the output of the following program?

#include <stdio.h>

int main()

{

    if( (-100 && 100)||(20 && -20) )

        printf("Condition is true.");

    else

        printf("Condition is false.");

    return 0;

}
  1. ACondition is true.
  2. BCondition is false.
  3. CNo output
  4. DERROR
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a=10;

    if(a==10){

        printf("Hello...");

        break;

    }

    else{

        printf("Hii");

    }

    return 0;

}
What will be the output of the following program?

#include <stdio.h>

int main(){

    int a=10;

    if(a==10){

        printf("Hello...");

        break;

    }

    else{

        printf("Hii");

    }

    return 0;

}
  1. AHello...
  2. BHello...OK
  3. COK
  4. DError
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

void main()

{

    char val=1;

    if(val--==0)

        printf("TRUE");

    else

        printf("FALSE");

}
What will be the output of the following program?

#include <stdio.h>

void main()

{

    char val=1;

    if(val--==0)

        printf("TRUE");

    else

        printf("FALSE");

}
  1. AFALSE
  2. BError
  3. CTRUE
  4. DNone
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

void main()

{

    int x=22;

    if(x=10)

        printf("TRUE");

    else

        printf("FALSE");

}
What will be the output of the following program?

#include <stdio.h>

void main()

{

    int x=22;

    if(x=10)

        printf("TRUE");

    else

        printf("FALSE");

}
  1. ATRUE
  2. BFALSE
  3. CError
  4. DNone
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

#include <stdio.h>

void main()

{

    if(printf(""))

        printf("Okkk");

    else

        printf("Hiii");

}
What will be the output of the following program?

#include <stdio.h>

void main()

{

    if(printf(""))

        printf("Okkk");

    else

        printf("Hiii");

}
  1. AOkkk
  2. BHiii
  3. CError
  4. DNone
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 17उत्तर app में
C प्रोग्राम का आउटपुट क्या होता है?

int main()

{

    if(TRUE)

    {

        printf("India ");

    }

    if(true)

    {

        printf("Honey ");

    }

    printf("ZING");

 

    return 0;

}
What is the output of the C program?

int main()

{

    if(TRUE)

    {

        printf("India ");

    }

    if(true)

    {

        printf("Honey ");

    }

    printf("ZING");

 

    return 0;

}
  1. AIndia ZING
  2. BHoney ZING
  3. CIndia Honey ZING
  4. Dकम्पाइलर एररCompiler error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  float a = 1.3;

  if(1.3f==a) printf("true");

  else printf("false");

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  float a = 1.3;

  if(1.3f==a) printf("true");

  else printf("false");

  return 0;

}
  1. Afalse
  2. Bइनमें से कोई नहींNone of these
  3. Ctrue
  4. Dएररerror
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  float a = 1.0;

  if(1.0==a) printf("true");

  else printf("false");

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  float a = 1.0;

  if(1.0==a) printf("true");

  else printf("false");

  return 0;

}
  1. Afalse
  2. Bएररerror
  3. Ctrue
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  float a = 1.2;

  if(1.2==a) printf("true");

  else printf("false");

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  float a = 1.2;

  if(1.2==a) printf("true");

  else printf("false");

  return 0;

}
  1. Afalse
  2. Bएररerror
  3. Ctrue
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  if(5 && 5 == 5)

       printf("true");

  else

       printf("false");

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  if(5 && 5 == 5)

       printf("true");

  else

       printf("false");

  return 0;

}
  1. Aएररerror
  2. Btrue
  3. Cइनमें से कोई नहींNone of these
  4. Dfalse
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  if("true")

     printf("a");

  else

     printf("b");

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  if("true")

     printf("a");

  else

     printf("b");

  return 0;

}
  1. Aएररerror
  2. Ba
  3. Cb
  4. Dab
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  if(-5)

  {

    printf("a");

    printf("b");

  }

  else;

  {

    printf("c");

    printf("d");

  }

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  if(-5)

  {

    printf("a");

    printf("b");

  }

  else;

  {

    printf("c");

    printf("d");

  }

  return 0;

}
  1. Acd
  2. Bab
  3. Cabcd
  4. DCompile time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।

#include<stdio.h>

int main()

{

  if(-5)

  printf("a");

  printf("b");

  else

  printf("c");

  printf("d");

  return 0;

}
Find the output of the given C program.

#include<stdio.h>

int main()

{

  if(-5)

  printf("a");

  printf("b");

  else

  printf("c");

  printf("d");

  return 0;

}
  1. Aabd
  2. Bcd
  3. CCompile time error
  4. Dab
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    if (printf("%d", printf("")))

        printf("We are Happy");

    else if (printf("1"))

        printf("We are Sad");

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

#include <stdio.h>

int main(){

    if (printf("%d", printf("")))

        printf("We are Happy");

    else if (printf("1"))

        printf("We are Sad");

}
  1. A0We are Happy
  2. B1We are Happy
  3. C1We are Sad
  4. Dकम्पाइल टाइम एररcompile time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a = 1;

    if (a)

        printf("FliQi ");

        printf("FliQi Education\n");

    else

        printf("India\n");

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

#include <stdio.h>

int main(){

    int a = 1;

    if (a)

        printf("FliQi ");

        printf("FliQi Education\n");

    else

        printf("India\n");

}
  1. Aआउटपुट FliQi FliQi Education होगाOutput will be FliQi FliQi Education
  2. Bआउटपुट FliQi Education India होगाOutput will be FliQi Education India
  3. Cआउटपुट FliQi Education होगाOutput will be FliQi Education
  4. Dकम्पाइल के समय एरर आएगाCompile time errors during compilation
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 27उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int a = 1;

    if (a--)

        printf("FliQI");

        if (a++)

            printf("India");

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

#include <stdio.h>

int main(){

    int a = 1;

    if (a--)

        printf("FliQI");

        if (a++)

            printf("India");

}
  1. AFliQI
  2. BIndia
  3. CFliQI India
  4. Dकोई आउटपुट नहींNo Output
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 29उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

    int main()

    {

        int x = 0;

        if (x == 1)

            if (x >= 0)

                printf("Hello\n");

            else

                printf("FliQi\n");

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

#include <stdio.h>

    int main()

    {

        int x = 0;

        if (x == 1)

            if (x >= 0)

                printf("Hello\n");

            else

                printf("FliQi\n");

    }
  1. AHello
  2. BFliQi
  3. Cकम्पाइलर पर निर्भरDepends on the compiler
  4. Dकुछ भी प्रिंट नहीं होगाPrint Nothing
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 30उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

#include <stdio.h>

int main(){

    int x = 0;

    if (x == 0)

        printf("Hello, ");

    if (x = 10)

        printf("FliQi, ");

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

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

#include <stdio.h>

int main(){

    int x = 0;

    if (x == 0)

        printf("Hello, ");

    if (x = 10)

        printf("FliQi, ");

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

}
  1. AFliQi, 0
  2. BHello, 0
  3. CHello, FliQI, 10
  4. Dकम्पाइल टाइम एररcompile time error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
If Else Statement in C Language के सभी 53 प्रश्न — उत्तर, हल और अभ्यास

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

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

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

C Language के दूसरे topics

सभी topics