C Programming Language Output this code Quizzes 1


  • 1. What is the output of the below c code?

    #include<stdio.h>	
    main() 
    {
       int x = 5;
       
       if(x=5)
       {	
          if(x=5) printf("Fast");
       } 
       printf("learning");
    }





  • 2. What is the size of the following union definition?

    #include<stdio.h>
    
    union abc { 
        char a,b,c,d,e,f,g,h; 
        int i;
    }abc;
    
    main()
    {
       printf( "%d", sizeof( abc ));
    }





  • 3. What is the output of the following program?

    #include<stdio.h>
    main()
    {	
       union abc {
          int x;
          char ch;
       }var;
    
       var.ch = 'A';
       printf("%d", var.x);
    }
    





  • 4. What is the output of the following statement?

    #include<stdio.h>
    
    main()
    { 
       printf("%d", !0<2);
    }





  • 5. What is x in the following program?

    #include<stdio.h>
    
    int main ()
    {
       typedef char (*(*arrfptr[3])())[10];
       arrfptr x
       return 0;
    }
    





  • 6. Predict the output of the following C snippets

    #include<stdio.h>
    int main()
    {
    	int main = 56;
    	printf("%d", main);
    	return 0;
    }





  • 7. What is the output of this C code?

    #include<stdio.h>
    int main()
    {
       float a = 3.14, *fptr;
       fptr = &a;
     
       printf("Size of Float Pointer : %d", sizeof(fptr));
       return (0);
    }
    





  • 8. What is the output of the below c code?

    #include<stdio.h>
    int main()
    {
        char ch;
        if(ch = printf(""))
            printf("It matters\n");
        else
            printf("It doesn't matters\n");
        return 0;
    }
    





  • 9. How many times is Hello world printed ?

    #include<stdio.h>
    int main()
    {
        fork();
        fork();
        printf("Hello world\n");
    }
    





  • 10. What is the output of this C code?

    #include<stdio.h>
    int main()
    {
        int y = 2;
        int z = y +(y = 10);
        printf("%d\n", z);
    }