C Programming Language : Experts


1. Which of the following data types are accepted while declaring bit-fields?




2. Which of the following reduces the size of a structure?




3. stderr is similar to??




4. What will be the output of the code ________?


    #include<stdio.h>

    int main()

    {

        FILE *fp = stdout;

        stderr = fp;

        fprintf(stderr, "%s", "Minigranth");

    }



5. What will be the output of the code ________?


    #include<stdio.h>

    int main()

    {

        char str[10] = "hello";

        char *p = strrchr(str, 'l');

        printf("%c\n", *(++p));

    }



6. What will be the output of the code ________?


    #include<stdio.h>
    #include<stdlib.h>

    int main()

    {

        printf("%d\n", rand() % 1000);

        return 0;

    }    



7. What will be the output of the code ________?


    #include<stdio.h>

    int main()

    {

        char line[3];
        
        fgets(line, 3, stdin);
        
        printf("%d\n", strlen(line));
        
        return 0;
        
    }



8. What will be the output of the code ________?


    #include<stdio.h>

    int main()

    {

        srand(9000);

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

        return 0;

    }



9. What will be the output of the code ________?


    #include<stdio.h>

    typedef struct student

    {

        char *a;
        
    }stu;
    
    void main()
    
    {

        stu s;
        
        s.a = "Minigranth";
        
        printf("%s", s.a);
        
    }s



10. What will be the output of the code ________?


    #include<stdio.h>

    int main()

    {

        char line[3];

        FILE *fp;

        fp = fopen("newfile.txt", "r");

        while (fgets(line, 3, fp))

        fputs(line, stdout);

        return 0;

    }