Skip to content
  • Home
  • CCNA Labs
    • CCNA 1 LAB Activities (v6 & v7)
    • CCNA 2 LAB Activities (v6 & v7)
    • CCNA 3 LAB Activities (v6 & v7)
    • CCNA 4 Lab Activities
  • Linux
    • Linux Unhatched
    • Linux Essentials 2.0
    • Linux Essentials
    • Introduction to Linux I
    • Introduction to Linux II
  • Programming
    • PCAP – Programming Essentials in Python
    • CLA – Programming Essentials in C
    • CPA Programming Essentials in C++
  • About
    • Contact Us
    • Privacy Policy

CCNA 7 Exam Answers 2023

Go with our CCIE, Passed 100%

  • ITE
    • ITE - IT Essentials v7.0
    • ITE - IT Essentials v6.0
      • IT Essentials Lab 2019
    • ITE v5.0 Exam
    • Virtual Activity Laptop
    • Virtual Activity Desktop
  • NE
    • MF
  • CCNA
    • CCNA1
      • CCNA1 v7.0 – ITN
      • CCNA1 v6.0
    • CCNA2
      • CCNA2 v7.0 – SRWE
      • CCNA2 v6.0
    • CCNA3
      • CCNA3 v7.0 – ENSA
      • CCNA3 v6.0
    • CCNA4
      • CCNA4 v6.0
  • Cyber-Security
    • ITC – Introduction to Cybersecurity 2.1 (Level 1)
    • CE – Cybersecurity Essentials 1.1 (Level 2)
    • CCNA CyberOps 1.1 (Level 3)
  • Security
    • CCNA Security v2
  • DevNet
  • CCNA PT Lab 2023

CPA Chapter 2 Assessment Answers 100%

Last Updated on May 20, 2021 by Admin

CPA Chapter 2 Assessment Answers 100%

  1. What is the output of the following snippet?

    int i = 0, j = i++, k = –i;
    if(i > 0)
    j++;
    else
    k++;
    if(k == 0)
    i++;
    else if(k > 0)
    k–;
    else
    k++;
    cout << i * j * k;

    • 0
    • -1
    • 2
    • 1
  2. What is the output of the following snippet?

    int i = 1, j = i++, k = –i;
    if(i > 0) {
    j++;
    k++;
    }
    else {
    k++;
    i++;
    }
    if(k == 0) {
    i++;
    j++;
    }
    else {
    if(k > 0)
    k–;
    else
    k++;
    i++;
    }
    cout << i * j * k;

    • 2
    • 4
    • 8
    • 0
  3. What is the output of the following snippet?

    double big = 1e15;
    double small = 1e-15;

    cout << fixed << big + small;

    • 0.0
    • 1000000000000000.000000
    • 1.01e15
    • 1000000000000000.0000000000000001
  4. What is the output of the following snippet?

    bool yes = !false;
    bool no = !yes;
    if(!no)
    cout << “true”;
    else
    cout << “false” ;

    • not
    • yes
    • true
    • false
  5. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int i = 5, j = 0;
    while(i > 0) {
    i–;
    j++;
    }
    cout << j;
    return 0;
    }

    • 4
    • 5
    • 2
    • 3
  6. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int i = 3, j = 0;
    do {
    i–;
    j++;
    } while(i >= 0);
    cout << j;
    return 0;
    }

    • 4
    • 2
    • 3
    • 5
  7. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    float val = 100.0;
    do {
    val = val / 5;
    cout << “*”;
    } while(val > 1.0);
    return 0;
    }

    • **
    • ***
    • *****
    • ****
  8. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    for(float val = -10.0; val < 100.0; val = -val * 2)
    cout << “*”;
    return 0;
    }

    • ***
    • ****
    • *****
    • **
  9. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    for(float val = -10.0; val < 100.0; val = -val * 2) {
    if(val < 0 && -val >= 40)
    break;
    cout << “*”;
    }
    return 0;
    }

    • ****
    • **
    • *****
    • ***
  10. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int a = 1, b = 2;
    int c = a | b;
    int d = c & a;
    int e = d ^ 0;
    cout << e << d << c;
    return 0;
    }

    • 113
    • 100
    • 131
    • 031
  11. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int a = 1, b = 2;
    int c = a << b;
    int d = 1 << c;
    int e = d >> d;
    cout << e;
    return 0;
    }

    • 2
    • 0
    • 4
    • 1
  12. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int a = 2;
    switch(a << a) {
    case 8 : a++;
    case 4 : a++;
    case 2 : break;
    case 1 : a–;
    }
    cout << a;
    return 0;
    }

    • 3
    • 2
    • 5
    • 4
  13. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int t[] = { 8, 4, 3, 2, 1 }, i;
    for(i = t[4]; i < t[0]; i++)
    t[i – 1] = -t[3];
    cout << i;
    return 0;
    }

    • 4
    • 3
    • 2
    • 5
  14. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    bool t[5];
    for(int i = 0; i < 5; i++)
    t[4 – i] = !(i % 2);
    cout << t[0] && t[2];
    return 0;
    }

    • true
    • 0
    • 1
    • false
  15. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int a[] = {4, 0, 3, 1, 2};
    int b[] = {1, 2, 3, 4, 5};

    for(int i = 0; i < 5; i++)
    b[a[i]] = b[4 – i];
    cout << b[0] << b[4];
    return 0;
    }

    • 54
    • 15
    • 45
    • 51
  16. What is the output of the following snippet?

    #include <iostream>
    using namespace std;
    int main() {
    int g[3][3] = {{2, 4, 8}, {3, 6, 9}, {5, 10, 15}};
    for(int i = 2; i >= 0; i–)
    for(int j = 0; j < 3; j++)
    g[i][j] += g[j][i];
    cout << g[1][1];
    return 0;
    }

    • 9
    • 12
    • 6
    • 15
  17. What is the output of the following snippet?

    #include <iostream>
    using namespace std;

    struct str {
    int t[3];
    char s[3];
    };

    int main() {
    str a = { 1, 2, 3, ‘a’, ‘b’, ‘c’ };
    str b = { 5, 6, 7, ‘x’, ‘y’, ‘z’ };
    cout << char(b.s[0] + a.t[0]) << int(a.s[2] – a.s[0]) << int(b.s[2] – b.s[1]);
    return 0;
    }

    • z22
    • a11
    • y21
    • b12
  18. What is the output of the following snippet?

    #include <iostream>
    using namespace std;

    struct str {
    int t[3];
    char s[3];
    };

    int main() {
    str z[3];
    for(int i = 0; i < 3; i++)
    for(int j = 0; j < 3; j++) {
    z[i].s[j] = ‘0’ + i + j;
    z[j].t[i] = i + j;
    }
    cout << z[0].s[1] << z[1].t[2] << z[2].s[0];
    return 0;
    }

    • 312
    • 032
    • 123
    • 132
  19. What is the output of the following snippet?

    #include <iostream>
    using namespace std;

    struct sct {
    int t[2];
    };

    struct str {
    sct t[2];
    };

    int main() {
    str t[2] = { {0, 2, 4, 6}, {1, 3, 5, 7} };
    cout << t[1].t[0].t[1] << t[0].t[1].t[0];
    return 0;
    }

    • 43
    • 34
    • 52
    • 25
  20. What is the output of the following snippet?

    #include <iostream>
    using namespace std;

    int main() {
    char arr[5] = { ‘a’, ‘b’, ‘c’, ‘d’, ‘e’ };
    for(int i = 1; i < 5; i++) {
    cout << “*”;
    if((arr[i] – arr[i – 1]) % 2)
    continue;
    cout << “*”;
    }
    return 0;
    }

    • ******
    • *******
    • *****
    • ****
  • CCNA1 v7
  • CCNA2 v7
  • CCNA3 v7
System Test Exam Answers
Modules 1 – 3 Exam Answers
Modules 4 – 7 Exam Answers
Modules 8 – 10 Exam Answers
Modules 11 – 13 Exam Answers
Modules 14 – 15 Exam Answers
Modules 16 – 17 Exam Answers
Practice Final – ITN Answers
Course Feedback
ITN Practice PT Skills Assessment (PTSA)
Final Exam Answers
Modules 1 – 4 Exam Answers
Modules 5 – 6 Exam Answers
Modules 7 – 9 Exam Answers
Modules 10 – 13 Exam Answers
Modules 14 – 16 Exam Answers
ITN Practice Skills Assessment – PT Answers
SRWE Practice Skills Assessment – PT Part 1 Answers
SRWE Practice Skills Assessment – PT Part 2 Answers
SRWE Hands On Skills Exam Answers
SRWE Practice Final Exam Answers
SRWE Final Exam Answers 
Modules 1 – 2 Exam Answers
Modules 3 – 5 Exam Answers
Modules 6 – 8 Exam Answers
Modules 9 – 12 Exam Answers
Modules 13 – 14 Exam Answers
ITN Practice PT Skills Assessment (PTSA) Answers
SRWE Practice PT Skills Assessment (PTSA) – Part 1 Answers
SRWE Practice PT Skills Assessment (PTSA) – Part 2 Answers
ENSA Practice PT Skills Assessment (PTSA) Answers
ENSA Hands On Skills Exam Answers
Practice Final – ENSA Answers
ENSA Final Exam Answers
CCNA Certification Practice Exam Answers

Copyright © 2023 PressExam.