C LANGUAGE QUIZ 9

0
Created on By Sirjana GhimireAcharya

C Language Quiz 9

1 / 10

  1. Choose the best statement with respect to the following three program snippets

for (i = 0; i < 10; i++)
{
continue;
}

i = 0;
while (i < 10)
{
continue;
i++;
}

i = 0;
do
{
continue;
i++;
}while(i<10);

2 / 10

2. What is the return type of malloc() or calloc()

3 / 10

3. What is the output of the following program?

void main(){
int a=2;
switch(a)
{
case 1: printf("A");
break;
case 2: printf("B");
continue;
case 3: printf("C");
break;
case 4; printf("D");
default: printf("E");
}
}

4 / 10

4. We use malloc and calloc for

5 / 10

5. What is the output of following program?

void main(){
int a=1;
a=a<<15;
printf("%d",a);
}

6 / 10

6. What do the following declaration signify?

 
int *f();

7 / 10

7. What will be the output of the program?

 
#include<stdio.h>
#define MAN(x, y) ((x)>(y)) ? (x):(y);
 
int main()
{
    int i=10, j=5, k=0;
    k = MAN(++i, j++);
    printf("%d, %d, %dn", i, j, k);
    return 0;
}

8 / 10

8. What will be the output of the program?

 
#include
#define MAX(a, b, c) (a>b ? a>c ? a : c: b>c ? b : c)
 
int main()
{
    int x;
    x = MAX(3+2, 2+7, 3+7);
    printf("%dn", x);
    return 0;
}

9 / 10

9. Declare the following statement?

"A pointer to an array of three chars".

10 / 10

10. Output of following C program?

#include<stdio.h>

#define max abc

#define abc 100

int main()

{

printf("maximum is %d", max);

return 0;

}

 

 

Your score is

The average score is 0%

0%