Quiz-1

Q 1. What will be the output of the following code snippet? / निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?
               #include <stdio.h>
int main(){
void  num=10;
                printf("%v", num);
                return 0;
}

  1. Compilation error
  2. 10
  3. Garbage value

Q 2. What will be the output of the following code snippet? / निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?
               #include <stdio.h>
void main()
{
   int a=1, b=2, c=3, d;
   d = (a=c, b+=a, c=a+b+c);
   printf("%d %d %d %d", d, a, b, c);
}

  1. 11 3 5 11
  2. 11 1 5 11
  3. 11 3 2 11
  4. 11 3 3 11

Q 3. What will be the output of the following code snippet? / निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?
                   #include <stdio.h>
                    int main() {
         int c = - -14; 
        printf("%d", c); 
        return 0;
    }

  1. 13
  2. 14
  3. -14
  4. Compile Time Error

Q 4. What will be the output of the following code snippet? / निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?
               #include <stdio.h>
            int num = 10;
int main() {
        int num = num;
        printf("%d ", num);
        return 0;
}

  1. 10
  2. Depends on the compiler
  3. Garbage

Q 5. Which operation will perform first as per the following code snippet? / निम्नलिखित कोड स्निपेट के अनुसार कौन सा ऑपरेशन पहले प्रदर्शन करेगा?
               #include <stdio.h>
int main() {
        int num = num;
        printf("%d ", num);
        return 0;
}

  1. Assignment Operation
  2. Variable Declaration
  3. Run Time Error
  4. Compile Time Error

Q 6. What would be the output obtained out of the program mentioned below? / नीचे उल्लिखित कार्यक्रम से क्या परिणाम प्राप्त होगा?
#include<stdio.h>
void main()
{
int x = 10;
char x = ‘A’;
printf("%d", x)
}

  1. 10
  2. A
  3. 65
  4. Compile Time Error

Q 7. What would be the output obtained out of the program mentioned below? / नीचे उल्लिखित कार्यक्रम से क्या परिणाम प्राप्त होगा?
#include <stdio.h>
int main()
{
int v= 12,13,14;
int z;
z= (12,13,14);
printf(“v= %d, z= %d\n”,v,z);
return 0;
}

  1. v= 13, z= 14
  2. v= 12, z=13
  3. v= 12, z= 14
  4. Compile-time Error

Q 8. What will be the output of the following code snippet? / निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?
            #include <stdio.h>
int main() {
    int scanf = 10;
    printf("%d",scanf);
    return 0;
            }

  1. 10
  2. Garbage Value
  3. Compile Time Error

Q 9. What will be the output of the following code snippet? / 29. निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?
            #include <stdio.h>
    int main() {
        int a = 20=30=50;
        printf("%d",a);
        return 0;
    }

  1. 10
  2. 30
  3. 50
  4. Compile Time Error

Q 10. What will be the output of the following code:- / निम्नलिखित कोड का आउटपुट क्या होगा:-
#include <stdio.h>
int a = 60;
int main() {
    int a = 110;
    {
        extern int a;
        printf("%d ",a);
    }
    printf("%d",a);
    return 0;
}

  1. 110 110
  2. 60 110
  3. 110 60
  4. Garbage 110