C++ Institute CLA - C Certified Associate Programmer Sample Questions:
1. What is the meaning of the following declaration?
float ** p;
Choose the right answer:
A) The declaration is erroneous
B) p is a pointer to a float
C) p is a pointer to a float pointer
D) p is a pointer to a pointer to a float
E) p is a float pointer to a float
2. What happens if you try to compile and run this program?
#define ALPHA 0
#define BETA ALPHA-1
#define GAMMA 1
#define dELTA ALPHA-BETA-GAMMA
#include <stdio.h>
int main(int argc, char *argv[]) {
printf ("%d", DELTA);
return 0;
Choose the right answer:
A) The program outputs -1
B) The program outputs 1
C) Compilation fails
D) The program outputs 2
E) The program outputs -2
3. Assume that ints are 32-bit wide.
What happens if you try to compile and run this program?
#include <stdio.h>
typedef union {
int i;
int j;
int k;
} uni;
int main (int argc, char *argv[]) {
uni s;
s.i = 3;
s.j = 2;
s.k = 1;
printf("%d",s.k * (s.i - s.j));
return 0;
}
Choose the right answer:
A) Compilation fails
B) The program outputs 0
C) The program outputs 3
D) The program outputs 9
E) Execution fails
4. What happens if you try to compile and run this program?
#include <stdio.h>
int main (int argc, char *argv[]) {
char *s = "\\\"\\\\";
printf ("[%c]", s [1]);
return 0;
}
Choose the right answer:
A) The program outputs []
B) Compilation fails
C) The program outputs []
D) The program outputs ["]
E) Execution fails
5. What happens if you try to compile and run this program?
#include <stdio.h>
int main (int argc, char *argv[]) {
int i = 7 || 0 ;
printf("%d", !! i);
return 0;
}
Choose the right answer:
A) The program outputs -1
B) The program outputs 7
C) The program outputs 1
D) Compilation fails
E) The program outputs 0
Solutions:
| Question # 1 Answer: D | Question # 2 Answer: C | Question # 3 Answer: B | Question # 4 Answer: E | Question # 5 Answer: C |
We're so confident of our products that we provide no hassle product exchange.


By Michell

