CPA – Programming Essentials in C++ Summary Test Answers Question 1: What is the value of the i variable? float x = 1.0 / 5.0; int i=x; 1 0.20 5.0 0 Question 2: What is the output of the following snippet? #include <iostream> #include <string> using namespace std; int main() …
Read More »CPA – Programming Essentials in C++ Module 1 Exam Answers
CPA – Programming Essentials in C++ Module 1 Exam Answers Question 1: What is the output of the following snippet if a digit 8 followed by Enter is entered through the keyboard? #include <iostream> using namespace std; int main() { int i; cin >> i; cout << …
Read More »CPA – Programming Essentials in C++ Module 2 Exam Answers
CPA – Programming Essentials in C++ Module 2 Exam Answers Question 1: What is the output of the following snippet? #include <iostream> using namespace std; int main() { int i = 1, j = i++, k = –i; if(i > 0) { j++; k++; } …
Read More »CPA – Programming Essentials in C++ Module 3 Exam Answers
CPA – Programming Essentials in C++ Module 3 Exam Answers Question 1: What is the output of the following snippet? #include <iostream> using namespace std; struct S { float *f; }; void make(S *p, float x = 10) { float *f = new float; *f = sizeof(*f) …
Read More »CPA – Programming Essentials in C++ Module 4 Exam Answers
Question 1: What is the output of the following snippet? #include <iostream> using namespace std; int main() { int *it[3]; for(int i = 0; i < 3; i++) { it[i] = new int [i + 1]; for(int j = 0; j < i + 1; j++) …
Read More »