Quiz-1

Q 1. What will be the output of the following C program? / निम्नलिखित 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");
}

  1. DelhiGurugramBanglore
  2. DelhiGurugram
  3. Jaipur
  4. Compile Time Error

Q 2. What will be the output of the following C program? / निम्नलिखित C प्रोग्राम का आउटपुट क्या होगा
#include <stdio.h>
int main(){
    int a=5, b=7;
      if(a<b)
          if(0)
                    printf("FliQi");
       else
                   printf("FliQi Education");
}

  1. FliQi
  2. FliQi Education
  3. Print Nothing
  4. Compile Time Error

Q 3. 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. 3 and 4
  2. 3 only
  3. 4 only
  4. 2,3 and 4

Q 4. What will be the output of following program ? / निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?
#include <stdio.h>
int main()
{
    if( (-100 && 100)||(20 && -20) )
        printf("Condition is true.");
    else
        printf("Condition is false.");
    return 0;
}

  1. Condition is true.
  2. Condition is false.
  3. No output
  4. ERROR

Q 5. What will be the output of following program ? / निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?
#include <stdio.h>
void main()
{
    int x=22;
    if(x=10)
        printf("TRUE");
    else
        printf("FALSE");
}

  1. TRUE
  2. FALSE
  3. Error
  4. None

Q 6. Find the output of the given C program. / दिए गए C प्रोग्राम का आउटपुट ज्ञात कीजिए।
#include<stdio.h>
int main()
{
  float a = 1.2;
  if(1.2==a) printf("true");
  else printf("false");
  return 0;
}

  1. false
  2. error
  3. true
  4. None of these

Q 7. Point out the errors, if any, in the following programs:
#include<stdio.h>
int main()
{
int i = 10, j = 10;
if (i && j == 10)
printf (“Have a nice day\n”);
return 0;
}

  1. Have a nice day
  2. Print Nothing
  3. CTE
  4. RTE

Q 8. What will be the output of the following programs:
#include<stdio.h>
int main()
{
int x = 10, y=20;
if(x==y);
printf (“%d %d\n”,x,y);
return 0;
}

  1. 10 20
  2. 20 10
  3. Print Nothing
  4. Compile Time Error

Q 9. What will be the output of the following programs:
#include<stdio.h>
int main()
{
int a = 500, b, c;
if(a >= 400)
b=300;
c=200;
printf (“%d\n”,b,c);
return 0;
}

  1. 300 200
  2. 500 300
  3. 300 300
  4. 300 500

Q 10. What will be the output of the following programs:
#include<stdio.h>
int main()
{
int a = 300, b=400, c;
if(a >= 400)
b=300;
c=200;
printf (“%d%d \n”,b,c);
return 0;
}

  1. 300 300
  2. 300 200
  3. 300 400
  4. 400 200