Vous êtes sur la page 1sur 14

ExamChapter 6 Assessment (CLA)Time left: 44:52

1.What happens if you try to compile and run this program?

void f(void) {

int main(void) {

int i;

i = f();

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs NULL

compilation fails<xx

the program outputs nul

the program outputs 0

2.What happens if you try to compile and run this program?

#include <stdio.h>

int f(void) {

int main(void) {

int i;

i = f();

printf("%d",i);

return 0;

}
Select correct answer (single choice)

the compilation fails

the program outputs NULL

the program outputs an unpredictable value<xx

the program outputs 0

3.What happens if you try to compile and run this program?

#include <stdio.h>

void f(int i) {

i++;

int main(void) {

int i = 1;

f(i);

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 1 <XX

the program outputs an unpredictable value

the compilation fails

the program outputs 2

4.What happens if you try to compile and run this program?


#include <stdio.h>

int f(int i) {

return ++i;

int main(void) {

int i = 1;

i = f(i);

printf("%d",i);

return 0;

Select correct answer (single choice)

the compilation fails

the program outputs 2 <xx

the program outputs 1

the program outputs an unpredictable value

5.What happens if you try to compile and run this program?

#include <stdio.h>

int f(int i) {

return ++i;

int main(void) {

int i = 0;

i = f(f(i));

printf("%d",i);
return 0;

Select correct answer (single choice)

the program outputs 0

the compilation fails

the program outputs 2 <xx

the program outputs 1

6.What happens if you try to compile and run this program?

#include <stdio.h>

int main(void) {

int i = 0;

int i = 1;

main.i = i;

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 2

compilations fails <xx

the program outputs 0

the program outputs 1

7. What happens if you try to compile and run this program?

#include <stdio.h>

int i = 0;
void f(void) {

int i = 1;

int main(void) {

int i = 2;

f();

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 1

the program outputs 0

the compilation fails

the program outputs 2 <xx

8.What happens if you try to compile and run this program?

#include <stdio.h>

int i = 0;

void f(void) {

int i = 1;

int main(void) {

f();

printf("%d",i);

return 0;

Select correct answer (single choice)


the program outputs 1

the program outputs 2

the compilation fails

the program outputs 0 <xx

9.What happens if you try to compile and run this program?

#include <stdio.h>

int i = 1;

int *f(void) {

return &i;

int main(void) {

int i = 0;

i = *f();

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 2

the compilation fails

the program outputs 1 <xx

the program outputs 0

10.What happens if you try to compile and run this program?

#include <stdio.h>

int i = 2;

int *f(void) {
return &i;

int main(void) {

int *i;

i = f();

printf("%d",++(*i));

return 0;

Select correct answer (single choice)

the program outputs 1

the compilation fails

the program outputs 2

the program outputs 3 <xx

11.What happens if you try to compile and run this program?

#include <stdio.h>

int i = 0;

int *f(int *i) {

(*i)++;

return i;

int main(void) {

int i = 1;

i = *f(&i);

printf("%d",i);

return 0;

}
Select correct answer (single choice)

the program outputs 0

the program outputs 2 <xx

the program outputs 1

the compilation fails

12.What happens if you try to compile and run this program?

#include <stdio.h>

struct S {

int S;

};

int f(struct S s) {

return --s.S;

int main(void) {

int i;

struct S S = { 2 };

i = f(S);

printf("%d",i);

return 0;

.Select correct answer (single choice)

the program outputs 0

the compilation fails

the program outputs 2

the program outputs 1 <xx


13.What happens if you try to compile and run this program?

#include <stdio.h>

struct S {

int S;

};

int f(struct S *s) {

return --s.S;

int main(void) {

int i;

struct S S = { 2 };

i = f(S);

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 0

the program outputs 1

compilation fails <xx

the program outputs 2

14.What happens if you try to compile and run this program?

#include <stdio.h>

int f(int t[]) {

return t[0] + t[2];


}

int main(void) {

int i,a[] = { -2,-1,0,1,2 };

i = f(a + 2);

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 1

the program outputs 0

the compilation fails

the program outputs 2 <xx

15.What happens if you try to compile and run this program?

#include <stdio.h>

int f(int t[][]) {

return t[0][0] + t[1][0];

int main(void) {

int i,a[2][2] = { {-2,-1},{1,2} };

i = f(a + 2);

printf("%d",i);

return 0;

Select correct answer (single choice)

compilation fails < xx


the program outputs 2

the program outputs 0

the program outputs 1

16.What happens if you try to compile and run this program?

#include <stdio.h>

int f(int t[2][]) {

return t[0][0] + t[1][0];

int main(void) {

int i,a[2][2] = { {-2,-1},{1,2} };

i = f(a + 2);

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 2

compilation fails <xx

the program outputs 1

the program outputs 0

17.What happens if you try to compile and run this program?

#include <stdio.h>

int f(char t[]) {

return t[1] - t[0];

}
int main(void) {

int i = 2;

i -= f("ABDGK" + 1);

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 1

the program outputs 0

the program outputs 2

the compilation fails

18.What happens if you try to compile and run this program?

#include <stdio.h>

int f(char t[]) {

return t[0] - t[-1];

int main(void) {

int i = 2;

i -= f("ABDGK" + 1);

printf("%d",i);

return 0;

Select correct answer (single choice)

the program outputs 1

the program outputs 2

the program outputs 0


the compilation fails

What happens if you try to compile and run this program?

#include <stdio.h>

#include <string.h>

void f(char *s,int i) {

*(s + i) = '\0';

int main(void) {

char a[] = { 'a','b','c','d' };

f(*a[1],1);

printf("%d",strlen(a));

return 0;

Select correct answer (single choice)

the program outputs 2

the program outputs 1

compilation fails

the program outputs 0

What happens if you try to compile and run this program?

#include <stdio.h>

#include <string.h>
void f(char *s,int i) {

*(s + i) = '\0';

int main(void) {

char a[] = { 'a','b','c','d' };

f(a+1,1);

printf("%d",strlen(a));

return 0;

Select correct answer (single choice)

the compilation fails

the program outputs 0

the program outputs 2

the program outputs 1

1. ambele variante

2. diffrent choise

3. unixlinux systems

4. ms windows systems

5. err compilation

6. err compilation

7. 1

Save and End Exam

Vous aimerez peut-être aussi