C Questions

0 votes, 0 avg
247

C Questions

1 / 15

1. What is the default return type if it is not specified in function definition?

2 / 15

2. scanf() is a predefined function in______header file.

3 / 15

3. Is initialisation mandatory for local static variables?

4 / 15

4. Choose facts about continue; statement is C Language.

5 / 15

5. Which statement is required to execute a block of code when the condition is false?

6 / 15

6. What will be the output of the following C code?

        #include 

        struct student

        {

            int no = 5;

            char name[20];

        };

        void main()

        {

            struct student s;

            s.no = 8;

            printf("hello");

        }

7 / 15

7. What is the output of C Program.?

int main()
{
    int a=0, b=0;
    while(++a < 4)
        printf("%d ", a);

    while(b++ < 4)
        printf("%d ", b);

    return 0;
}

8 / 15

8. What does the following program print?

#include
void f(int *p, int *q)
{
  p = q;
 *p = 2;
}
int i = 0, j = 1;
int main()
{
  f(&i, &j);
  printf("%d %d n", i, j);
  getchar();
  return 0;
}

9 / 15

9. Global variables are ____________

10 / 15

10. What will be the output of the following C code?

    #include 

    void main()

    {

        int i = 0;

        while (i < 10)

        {

            i++;

            printf("hin");

            while (i < 8) 

            {

                i++;

                printf("hellon");

            }

        }

    }

11 / 15

11. What will be the output of the following C code?

        #include 

        int *m();

        void main()

        {

            int *k = m();

            printf("hello ");

            printf("%d", k[0]);

        }

        int *m()

        {

            int a[2] = {5, 8};

            return a;

        }

12 / 15

12. Which of the following is an exit controlled loop?

13 / 15

13. double ______ (double x, double y) computes the floating-point remainder of x/y.

14 / 15

14. Which of the following format specifiers is used to specify whether the given time is in AM or PM?

15 / 15

15. Choose a correct statement about C language break; statement.

Your score is

The average score is 30%

0%