C LANGUAGE QUIZ 10

0
Created on By Sirjana GhimireAcharya

C Language Quiz 10

1 / 10

  1. Consider the following statements

#define hypotenuse (a, b) sqrt (a*a+b*b);
The macro call hypotenuse(a+2,b+3);

2 / 10

2.What will be the output of the program ?

#include

int main()
{
int i=3, *j, k;
j = &i;
printf("%dn", i**j*i+*j);
return 0;
}

3 / 10

3.What will be the output of the program?

#include

int main()
{
const c = -11;
const int d = 34;
printf("%d, %dn", c, d);
return 0;
}

4 / 10

4.  What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

5 / 10

5. What will be the output of the program?

 
#include<stdio.h>
 
int main()
{
    char far *near *ptr1;
    char far *far *ptr2;
    char far *huge *ptr3;
    printf("%d, %d, %dn", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
    return 0;
}

6 / 10

6. What do the following declaration signify?

char **argv;

7 / 10

7. What will be the output of the program?

#include<stdio.h>
 
int main()
{
    int y=85;
    const int x=y;
    printf("%dn", x);
    return 0;
}

 

8 / 10

8.In which stage the following code

#include<stdio.h> 
gets replaced by the contents of the file stdio.h

9 / 10

9. What is the use of "#pragma once"?

10 / 10

10. The following program won’t compile because there’re space between macro name and open parenthesis.

#include "stdio.h"
#define MYINC   (  a  )  (  ( a )  +  1 )
int main()
{
 printf("Hi!");
 return 0;
}

Your score is

The average score is 0%

0%