C LANGUAGE QUIZ 8

1
Created on By Sirjana GhimireAcharya

C Language Quiz 8

1 / 10

  1. 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 ));
}

2 / 10

2. "Stderr" is a standard error.

3 / 10

3.  In the standard library of C programming language, which of the following header file is designed for basic mathematical operations?

4 / 10

4. What will be the output o program?

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

5 / 10

5. Which of the given printf statement(s) would be able to print arr[5][5][5]

(i) printf("%d",arr[5][5][5]);

(ii) printf("%d",*(*(*(arr+5)+5)+5));

(iii) printf("%d",(*(*(arr+5)+5))[5]);

(iv) printf("%d",*((*(arr+5))[5]+5));

6 / 10

6. Pick the correct statement for the below program:

#include "stdio.h"

 

void fun(int n)

{

int idx;

int arr1[n] = {0};

int arr2[n];

for (idx=0; idx<n; idx++)

arr2[idx] = 0;

}

int main()

{

fun(4);

return 0;

}

7 / 10

7. What is the output of the following program?

#include<stdio.h>

main()
{
int a[] = {20,30,40,50};

printf("%d", *a);
}

8 / 10

8. 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);
}

9 / 10

9. What’s going to happen when we compile and run the following C program snippet?

#include "stdio.h"
int main()
{
int a = 20;
int b = 30;

printf("=%d",(a+1),(b=a+2));
printf(" %d=",b);

return 0;
}

10 / 10

10.  extern int fun(); - The declaration indicates the presence of a global function defined outside the current module or in another file.

Your score is

The average score is 30%

0%