C Questions

0 votes, 0 avg
86

C Questions

1 / 15

1. What is output of below program?


int main()
{
int i,j,count;
count=0;
for(i=0; i<5; i++);
{ 
for(j=0;j<5;j++);
{
    count++;
}
}
printf("%d",count);
return 0;
}

2 / 15

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

        #include 

        int main()

        {

            printf("%d ", 1);

            goto l1;

            printf("%d ", 2);

            l1:goto l2;

            printf("%d ", 3);

            l2:printf("%d ", 4);

       }

3 / 15

3. Which C keyword is used to extend the visibility of variables?

4 / 15

4. Which of the following is true about return type of functions in C?

5 / 15

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

        #include 

        int main()

        {

            int x = 0;

            if (x == 1)

                if (x == 0)

                    printf("inside ifn");

                else

                    printf("inside else ifn");

            else

                printf("inside elsen");

        }

6 / 15

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

7 / 15

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

8 / 15

8. Which of the following is true for the static variable?

9 / 15

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

10 / 15

10. 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;
}

11 / 15

11. Which option should be selected to work the following C expression?

string p = "HELLO";

12 / 15

12. Global variables are ____________

13 / 15

13. What will be the output of the following C code if following commands are used to run (considering myfile exists)?

14 / 15

14. What is output of below program?


int main()
{
 int i,j;
 for(i = 0,j=0;i<5;i++)
 {
   printf("%d%d--",i,j);
 }
 return 0;
}

15 / 15

15. What is the format identifier for “static a = 20.5;”?

Your score is

The average score is 30%

0%