Weekend Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: suredis

C++ Institute CLA-11-03 CLA - C Certified Associate Programmer Exam Practice Test

Page: 1 / 4
Total 40 questions

CLA - C Certified Associate Programmer Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$42  $119.99

PDF Study Guide

  • Product Type: PDF Study Guide
$36.75  $104.99
Question 1

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

#include

int main (int argc, char *argv[]) {

int i = 1;

for(;i > 128;i *= 2);

printf("%d", i) ;

return 0;

}

-

Choose the right answer:

Options:

A.

The program enters an infinite loop

B.

Compilation fails

C.

The program outputs a value less than 128

D.

The program outputs 128

E.

The program outputs a value greater than 128

Question 2

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

#include

int main (int argc, char *argv[]) {

char i = 20 + 020 + 0x20;

printf("%d",i);

return 0;

}

Choose the right answer:

Options:

A.

The program outputs 68

B.

The program outputs 60

C.

Compilation fails

D.

The program outputs 86

E.

The program outputs 62

Question 3

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

#include

#include

int main (int argc, char *argv[]) {

double x = 1234567890.0;

printf ("%f",x);

return 0;

}

Choose the most precise answer:

Options:

A.

The program outputs 1234567900.0

B.

Execution fails

C.

The program outputs 1234567890.0

D.

Compilation fails

E.

The program outputs a value greater than 1234500000.0 and less than 1234600000.0

Question 4

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

#include

fun (void) {

static int n = 3;

return --n;

}

int main (int argc, char ** argv) {

printf("%d \n", fun() + fun());

return 0;

}

Select the correct answer:

Options:

A.

The program outputs 3

B.

The program outputs 0

C.

The program outputs 1

D.

The program outputs 2

E.

The program outputs 4

Question 5

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

#include

int main (int argc, char *argv[]) {

int i = 1, j = 0;

int 1 = !i + !! j;

printf("%d", 1);

return 0;

}

Choose the right answer:

Options:

A.

Compilation fails

B.

The program outputs 2

C.

The program outputs 3

D.

The program outputs 1

E.

The program outputs 0

Question 6

What happens when you compile and run the following program?

#include

int fun(void) {

static int i = 1;

i++;

return i;

}

int main (void) {

int k, l;

k = fun ();

l = fun () ;

printf("%d",l + k);

return 0;

}

Choose the right answer:

Options:

A.

The program outputs 5

B.

The program outputs 2

C.

The program outputs 1

D.

The program outputs 4

E.

The program outputs 3

Question 7

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

#include

int main (int argc, char *argv[]) {

int i = 'A' - 'B';

int j = 'b' - 'a';

printf("%d",i / j);

return 0;

}

Choose the right answer:

Options:

A.

Execution fails

B.

Compilation fails

C.

The program outputs 1

D.

The program outputs -1

E.

The program outputs 0

Question 8

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

#include

struct s {

int i;

};

void fun(struct S st) {

st.i --;

int main (void) {

int k;

struct $ str1 = { 2 };

fun (str1) ;

k =str1.i;

printf("%d", k);

return 0;

}

-

Choose the correct answer:

Options:

A.

The program outputs 3

B.

Compilation fails

C.

The program outputs 1

D.

The program outputs 2

E.

The program outputs 0

Question 9

What happens when you compile and run the following program?

#include

#define SYM

#define BOL 100

#undef SYM

int main (void) {

#ifdef SYM

int i = 100;

#else

int i= 200;

#endif

int j = i + 200;

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

return 0;

}

Select the correct answer:

Options:

A.

The program outputs 200

B.

The program outputs 100

C.

The program outputs 400

D.

The program outputs 300

E.

The program outputs 600

Question 10

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

enum { A, B, C, D, E, F };

#include

int main (int argc, char *argv[]) {

printf ("%d", B + D + F);

return 0;

}

Choose the right answer:

Options:

A.

The program outputs 10

B.

The program outputs 7

C.

The program outputs 8

D.

Compilation fails

E.

The progham outputs 9

Question 11

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

#include

int *fun(int *t) {

return t + 4;

}

int main (void) {

int arr[] = { 4, 3, 2, 1, 0 };

int *ptr;

ptr = fun (arr - 3);

printf("%d \n", ptr[2]);

return 0;

}

Choose the right answer:

Options:

A.

The program outputs 2

B.

The program outputs 4

C.

The program outputs 5

D.

The program outputs 1

E.

The program outputs 3

Question 12

What is the meaning of the following declaration?

float ** p;

Choose the right answer:

Options:

A.

p is a float pointer to a float

B.

The declaration is erroneous

C.

p is a pointer to a float pointer

D.

p is a pointer to a pointer to a float

E.

p is a pointer to a float

Page: 1 / 4
Total 40 questions