Exam Name: | CLA - C Certified Associate Programmer | ||
Exam Code: | CLA-11-03 Dumps | ||
Vendor: | C++ Institute | Certification: | C++ Institute Certification |
Questions: | 40 Q&A's | Shared By: | sonia |
Assume that we can open a file called "file1".
What happens when you try to compile and run the following program?
#include
int main (void) {
FILE *f;
int i;
f = fopen("file1","wb");
fputs("545454",f);
fclose (f);
f = fopen("file1","rt");
fscanf(f,"%d ", &i);
fclose (f) ;
printf("%d",i);
return 0;
}
Choose the right answer:
What happens when you compile and run the following program?
#include
int fun (void) {
static int i = 1;
i += 2;
return i;
}
int main (void) {
int k, 1;
k = fun ();
1 = fun () ;
printf ("%d", 1 - k);
return 0;
}
Choose the right answer:
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:
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: