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 Mock Test Online

Last Updated on May 20, 2021 by Admin

CPA Mock Test Online

CPA -- Mock Test

Time limit: 0

Quiz-summary

0 of 40 questions completed

Questions:

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40

Information

CPA — Mock Test

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading...

You must sign in or sign up to start the quiz.

You have to finish following quiz, to start this quiz:

Results

0 of 40 questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 points, (0)

Average score
 
 
Your score
 
 

Categories

  1. Not categorized 0%
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  1. Answered
  2. Review
  1. Question 1 of 40
    1. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

       

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

        {

          int a = 1, b = 1, c = 1, i = 1;

          i = b < a < c;

          cout << i;

          return 0;

        }

    Correct

    Incorrect

  2. Question 2 of 40
    2. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

       

        int main()

        {

               int val = 0, *adr = &val;

               cout << *val;

       

                return 0;

        }

    Correct

    Incorrect

  3. Question 3 of 40
    3. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int main(){

           int i = 2;

           if (i‑‑==1)

               cout << i;

           else

               cout << i + 1;

          return 0;

        }

    Correct

    Incorrect

  4. Question 4 of 40
    4. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        class One

        {

            public:

                    void out(){ cout<<“One”;}

        };

       

        int main()

        {

           One arr[2];

           for(int i = 0; i < 1; i++)

                 arr[i].out();

        }

    Correct

    Incorrect

  5. Question 5 of 40
    5. Question
    1 points

    Variable “c” in class B, will be…

     

        class A {

            int a;

        protected:

            int b;

        public:

            int c;

        };

           

           

        class B : public A {

            float f;

        public:

            void foo() {

                cout << f << c;

            }

        };

    Correct

    Incorrect

  6. Question 6 of 40
    6. Question
    1 points

    What is the output of the program given below?

     

        #include <iostream>

        using namespace std;

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

        {

              double dbl = ‑5.55;

              cout << (int)dbl;

        }

    Correct

    Incorrect

  7. Question 7 of 40
    7. Question
    1 points

    What is the output of the program given below?

     

        #include <iostream>

        using namespace std;

        void foo(int &parameter)

        {

                    parameter *= 2;

        }

        int main()

        {

              int var = 2;

              foo(var);

              cout << var;

              return 0;

        }

    Correct

    Incorrect

  8. Question 8 of 40
    8. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int main()

        {

             int a = ‑1, *p = &a;

             cout << ((p == NULL) ? 1.1 : 2.2);

             return 0;

        }

    Correct

    Incorrect

  9. Question 9 of 40
    9. Question
    2 points

    Which of the following statements are correct about the following array?

     

        char array[255];

    Correct

    Incorrect

  10. Question 10 of 40
    10. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int main(){

           int *Int = new int;

           *Int = 1 / 2 * 2 / 1. * 2. / 4 * 4;

           cout << *Int;    

           return 0;

        }

    Correct

    Incorrect

  11. Question 11 of 40
    11. Question
    2 points

    Which of the following is user defined data type?

     

        1:

                enum Enum {One, Two, Three};

       

        2:

                int Int=2;

               

        3:       

                char Char;

               

        4:

                struct Struct

                {

                        char Char;

                        int Int;

                };

       

    Correct

    Incorrect

  12. Question 12 of 40
    12. Question
    1 points

    Which code, inserted into the One class, generates the output “123”?

     

        #include <iostream>

        using namespace std;

        class One {

        public:

            //insert code here

        };

        class Two : public One {

        public:

                void foo(){ cout << 2; }

        };

        class Three : public Two {

        public:

                void foo(){ cout << 3; }   

        };

        int main()

        {

                One   o1;

                Two   o2;

                Three o3;

                One   *o = &o1;

                o‑>foo();

                o = &o2; o‑>foo();

                o = &o3; o‑>foo();

        }

    Correct

    Incorrect

  13. Question 13 of 40
    13. Question
    1 points

    Which code, inserted into the main function, generates the output “a 2”?

     

        #include <iostream>

        using namespace std;

        namespace Space

        {  char a = ‘a’, b = ‘b’;  }

        int a = 1, b = 2;

        int main () {

       

          // insert code here

          cout << a << ” ” << b;

          return 0;

        }

    Correct

    Incorrect

  14. Question 14 of 40
    14. Question
    1 points

    What is the output of the program given below?

     

        #include <iostream>

        using namespace std;

        int main ()

        {

          int i = 0;

          cout << i;

          { int i = 1; cout << i; }

          { int i = 2; }

          cout << i;

          return 0;

        }

    Correct

    Incorrect

  15. Question 15 of 40
    15. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        class foo {

                int p;

        protected:

                int q;

        public:

                int r;

        };

       

       

        class bar : public foo {

        public:

                void assign() {

                    p = q = r = 2;

                }

                void out() { cout << q << r; }

        };

        int main () {

                bar b;

                b.assign();

                b.out();

                return 0;

        }

    Correct

    Incorrect

  16. Question 16 of 40
    16. Question
    1 points

    What is the output of this program?

     

        #include <iostream>

        using namespace std;

        int main()

        {

           char str[] = “Hello\0World\0”;

           cout << str;

           return 0;

        }

    Correct

    Incorrect

  17. Question 17 of 40
    17. Question
    1 points

    Which code, inserted into the main function, generates the output “za”?

     

        #include <iostream>

        using namespace std;

        namespace SpaceOne {  char a = ‘a’; }

        namespace SpaceTwo {  char a = ‘z’; }

        int main () {

          // insert code here

          return 0;

        }

    Correct

    Incorrect

  18. Question 18 of 40
    18. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int main()

        {

                char i = ‘1’;

                switch(i)

                {

                    case ‘1’:

                        cout<<“Hello “;

                    case ‘2’:

                        cout<<“world “; break;

                    case ‘3’:

                        cout<<“!”;

                }        return 0;

        }

    Correct

    Incorrect

  19. Question 19 of 40
    19. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <cstdlib>

        #include <iostream>

        using namespace std;

        char c;

        char* inc(char par1, int par2)

        {

                c = par1 + par2;

                return &c;

        }

       

       

        int main()

        {

                int a = ‘a’, b = 3;

                char *f;

                f = inc(a,b);

                cout << *f;

                return 0;

        }

    Correct

    Incorrect

  20. Question 20 of 40
    20. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        #include <string>

        #include <exception>

        using namespace std;

        class a

        {

        public: virtual string whose()

                { return “mine”; }

        };

        class b

        {

        public: virtual string whose()

                { return “yours”; }

        };

        int main () {

          a b;

          try  { throw b; }

          catch (a& e)  { cout << e.whose() << endl; }

          return 0;

        }

    Correct

    Incorrect

  21. Question 21 of 40
    21. Question
    1 points

    Which code, inserted into the B class, generates the output “ef”?

     

        #include <iostream>

        #include <string>

        using namespace std;

        class Alpha {

                int p;

        protected:

                int q;

        public:

                int r;

                Alpha():p(2),q(3),r(4) {}

        };

        class Beta : public Alpha {

                string s;

        public:

                int y;

                void assign() {  y = 4; s = “f”;   }

                void out() {

                    // insert code here

                }

        };

        int main () {

                Beta b;

                b.assign();

                b.out();

                return 0;

        }

    Correct

    Incorrect

  22. Question 22 of 40
    22. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int sub(int x, int y)

        {

                x ‑= y;

                return x;

        }

        int main()

        {

                int a = 0, b = 1, c, d;

                c = sub(a,b);

                d = sub(c,b);

                cout << c << d;

                return 0;

        }

    Correct

    Incorrect

  23. Question 23 of 40
    23. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        class one { 

        public :

           void foo() { cout << 1; } 

        };

        class two {

        public :

           void foo() { cout << 2; }  

        };

        int main() {

           two objects[2];

           two *object = objects;

           for(int i = 0; i < 2; i++)

                (object++)‑>foo();

           return 0;

        }

    Correct

    Incorrect

  24. Question 24 of 40
    24. Question
    1 points

    What is the output of this program if the string “bar” is supplied as input?

     

        #include <iostream>

        #include <string>

        using namespace std;

        int main()

        {

           string s1 = “foo”;

           string s2;

           getline(cin,s2);

           cout << s2.append(s1);

           return( 0 );

        }

    Correct

    Incorrect

  25. Question 25 of 40
    25. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        char fun(char *p)

        {

           char c = *p;

           (*p)++;

           return c;

        }

        int main()

        {

                char array[3]={‘a’, ‘b’, ‘c’};

                fun(array + 1);

                cout << fun(array + 1);

                return 0;

        }

    Correct

    Incorrect

  26. Question 26 of 40
    26. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        #include <sstream>

        #include <string>

        using namespace std;

        int main(void)

        {

          string s;

          s = “abcd”;

          s.append(s);

          s.resize(s.size() / 2);

          cout << s;

          return 0;

        }

    Correct

    Incorrect

  27. Question 27 of 40
    27. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        class C1 {

        friend class C2;

        protected:  int y;

        public:     int z;

        private:    int x;

        public:     C1() { x = y = z = 11; }

        };

       

        class C2 {

        public: C1 a;

                C2 () { a.x = 22; };

                void foo() {

                    cout << a.x << a.y << a.z;

                }

        };

        int main()

        {

          C2 c;

          c.foo();

          return 0;

        }

    Correct

    Incorrect

  28. Question 28 of 40
    28. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        #include <string>

        using namespace std;

        int f(int a)

        {

                return a + a;

        }

        int main()

        {

                int i = 0;

                for(int a = 0; a < 2; a++)

                    i = f(i + 1);

                cout << i;

                return 0;

        }

    Correct

    Incorrect

  29. Question 29 of 40
    29. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        class Zero

        { public: void out(){ cout << 0;} };

        class One : public Zero

        { public: void out(){ cout << 1;} };

        class Two : public Zero

        { public: void out(){ cout << 2;} };

       

        int main()

        {

           Zero *obj;

           One obj1;

           obj = &obj1;

           obj‑>out();

           Two obj2;

           obj = &obj2;

           obj‑>out();

           return 0;

        }

    Correct

    Incorrect

  30. Question 30 of 40
    30. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

       

        class SupClass {

        public:

                void show(int par){ cout << par + 1;}

        };

       

        class SubClass : public SupClass {

        public:

                void show(float par){ cout << par + 2;}

        };

        int main()

        {

                SubClass o;

                o.show(2.0);

        }

    Correct

    Incorrect

  31. Question 31 of 40
    31. Question
    3 points

    Which code, inserted into function main, generates the output “abba”?

     

        #include <iostream>

        #include <string>

        using namespace std;

        string fun(string s)

        {

                return s.substr(0,1)+s.substr(1,1)+s.substr(1,1)+s.substr(0,1);

        }

        int main()

        {

                string *s = new string(“ab”);

                //insert code here

                return 0;

        }

    Correct

    Incorrect

  32. Question 32 of 40
    32. Question
    1 points

    What is the output of this program?

     

        #include <iostream>

        #include <string>

       

       

        using namespace std;

       

       

        int main()

        {

           string s1[]= {“A”,”Z”};

           string s=””;

          

           for (int i=0; i<2; i++)

                     cout << s.append(s1[i]).insert(1,”_”);

           return( 0 );

        }

    Correct

    Incorrect

  33. Question 33 of 40
    33. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int main()

        {

          float x = 0.9, y=‑0.5;

          int i,j = 1;

          i = x + j + y;

          cout << i;

          return 0;

        }

    Correct

    Incorrect

  34. Question 34 of 40
    34. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

       

        int main(){

          int i = 1;

          if (‑‑i == 1) {

              cout << i;

          } else {

              cout << ‑‑i;

          }

         return 0;

        }

    Correct

    Incorrect

  35. Question 35 of 40
    35. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

        int var = ‑1;

        int static Static(int i)

        {

          static int y = 0;

          y += ++i;

          return y;

        }

        int main()

        {

          var++;

          Static(var++);

          cout << var << Static(var);

        }

    Correct

    Incorrect

  36. Question 36 of 40
    36. Question
    1 points

    What is the output of the program given below?

     

        #include <iostream>

        using namespace std;

        int main ()

        {

          enum answer { yes, no, whoknows };

          enum answer a[3];

          a[0] = no;

          a[2] = yes;

          a[1] = whoknows;

          for(int i = 0; i < 3; i++)

            cout << a[i];

          return 0;

        }

    Correct

    Incorrect

  37. Question 37 of 40
    37. Question
    1 points
    How can we pass arguments to functions?
    Correct

    Incorrect

  38. Question 38 of 40
    38. Question
    1 points

    Which code, inserted into the Class, generates the output “abcd”?

     

        #include <iostream>

        using namespace std;

        class Class {

        public:

           static char value;

           Class() { value++; };

           ~Class () { value++; };

           //insert code here

           void print() { cout << value;}

        };

       

        char Class::value = ‘a’;

       

        int main () {

           Class a,*b;

           b = new Class();

           b‑>set(‘a’);

           b‑>print();

           delete b;

           a.print();

           a.set(‘c’);

           a.print();

           a.set();

           a.print();

           return 0;

        }

    Correct

    Incorrect

  39. Question 39 of 40
    39. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        void fun(int *i)

        {

                *i = *i >> *i ‑ 1;

        }

        using namespace std;

        int main()

        {

                int i = 2;

                fun(&i);

                cout << i;

                return 0;

        }

    Correct

    Incorrect

  40. Question 40 of 40
    40. Question
    1 points

    What happens when you attempt to compile and run the following code?

     

        #include <iostream>

        using namespace std;

       

        #define A    0

        #define B    A+1

        #define C    1‑B

       

        int main() {

            cout << C;

            return 0;

        }

    Correct

    Incorrect

  • 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.