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

CLA – Programming Essentials in C Quizzes Chapter 5 Assessment Exam Answers Full 100%

Last Updated on May 20, 2021 by Admin

CLA – Programming Essentials in C Quizzes Chapter 5 Assessment Exam Answers Full 100%

  1. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            char s[10] = "ABCDE", *p = s + 3; 
    
            printf("%d", p[1] - p[-1]); 
            return 0; 
        }
    • the program outputs 1
    • the program outputs 4
    • the program outputs 2
    • the program outputs 3
  2. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            char s[] = "ABCDE", *p = s + 5; 
        
            printf("%d", p[-1] - *(p - 4)); 
            return 0; 
        }

     

    • the program outputs 3
    • the program outputs 1
    • the program outputs 4
    • the program outputs 2
  3. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            char *p = "12345", *q = p - 10; 
    
            printf("%d", q[14] - q[13]); 
            return 0; 
        }

     

    • the program outputs 2
    • the program outputs 1
    • the program outputs 3
    • the program outputs 4
  4. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            int t[] = { 1, 2, 3, 4, 5 }, *p = t; 
    
            *p++; 
            (*p)++; 
            *p++; 
            printf("%d",p[-1]); 
            return 0; 
        }

     

    • the program outputs 1
    • the program outputs 4
    • the program outputs 2
    • the program outputs 3
  5. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            int t[2][2] = { 1, 2, 4, 8 }; 
            int s = 0, i, j; 
    
            for(i = 2; i; i -= 2) 
            	for(j = 1; j < 2; j += 2) 
            		s += t[i - 1][j]; 
            printf("%d",s); 
            return 0; 
        }

     

    • the program outputs 8
    • the program outputs 2
    • the program outputs 1
    • the program outputs 4
  6. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            int t[1][2][2] = { { { 1, 2 }, { 3, 4 } } }; 
            int s = 0, i, j, k; 
    
            for(i = 1; i > 0; i -= 2) 
            	for(j = 1; j < 2; j += 2) 
            		for(k = 0; k < 3; k += 3) 
            		s += t[k][i - 1][j]; 
            printf("%d",s); 
            return 0; 
        }

     

    • the program outputs 2
    • the program outputs 3
    • the program outputs 4
    • the program outputs 1
  7. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <stdlib.h> 
        int main(void) { 
            int *p = (int *)malloc(2 * sizeof(int)); 
            *p = 2; 
            *(p + 1) = *(p) - 1; 
            *p = p[1]; 
            printf("%d",*p); 
            free(p); 
            return 0; 
        }
    • the program outputs 3
    • the program outputs 1
    • the program outputs 2
    • the program outputs 4
  8. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <stdlib.h> 
        int main(void) { 
            int t[] = { 8, 4, 2, 1 }; 
            int *p = (int *)malloc(sizeof(t)); 
            int i; 
            for(i = 0; i < 4; i++) 
            	p[3 - i] = t[i]; 
            printf("%d",*(p + 2)); 
            free(p); 
            return 0; 
        }
    • the program outputs 3
    • the program outputs 1
    • the program outputs 2
    • the program outputs 4
  9. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <stdlib.h> 
        int main(void) { 
            int i,j; 
            int **p = (int **)malloc(2 * sizeof(int *)); 
            p[0] = (int *)malloc(2 * sizeof(int)); 
            p[1] = p[0]; 
            for(i = 0; i < 2; i++) 
            	for(j = 0; j < 2; j++) 
            		p[i][j] = i + j; 
            printf("%d",p[0][0]); 
            return 0; 
        }
    • the program outputs 1
    • the program outputs 4
    • the program outputs 2
    • the program outputs 3
  10. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <stdlib.h> 
        int main(void) { 
            int i,j; 
            int **p = (int **)malloc(2 * sizeof(int *)); 
            p[0] = (int *)malloc(2 * sizeof(int)); 
            p[1] = (int *)malloc(2 * sizeof(int)); 
            for(i = 0; i < 2; i++) 
            	for(j = 0; j < 2; j++) 
            		p[i][j] = i + j; 
            printf("%d",p[0][0]); 
            return 0; 
        }
    • the program outputs 0
    • the program outputs 2
    • the program outputs 3
    • the program outputs 1
  11. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            int *t[10]; 
            int (*u)[10]; 
            printf("%d",sizeof(t) != sizeof(u)); 
            return 0; 
        }
    • the program outputs 0
    • the program outputs 4
    • the program outputs 1
    • the program outputs 16
  12. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            int *(t[10]); 
            int *u[10]; 
            printf("%d",sizeof(t) != sizeof(u)); 
            return 0; 
        }
    • the program outputs 3
    • the program outputs 0
    • the program outputs 1
    • the program outputs 2
  13. What happens if you try to compile and run this program?

        #include <stdio.h> 
        struct S { 
            int S; 
        }; 
        int main(void) { 
            struct S S; 
            S.S = sizeof(struct S) / sizeof(S); 
            printf("%d",S.S); 
            return 0; 
        }
    • the program outputs 3
    • the program outputs 1
    • the program outputs 4
    • the program outputs 2
  14. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <string.h> 
        struct Q { 
            char S[3]; 
        }; 
        struct S { 
            struct Q Q; 
        }; 
        int main(void) { 
            struct S S = { '\0', '\0','\0' }; 
            S.Q.S[0] = 'A'; 
            S.Q.S[1] = 'B'; 
            printf("%d",strlen(S.Q.S)); 
            return 0; 
        }
    • the program outputs 4
    • the program outputs 1
    • the program outputs 2
    • the program outputs 3
  15. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <string.h> 
        struct Q { 
            char S[3]; 
        }; 
        struct S { 
            struct Q Q; 
        }; 
        int main(void) { 
            struct S S = { '\0', '\0','\0' }; 
            S.Q.S[0] = 'A'; 
            S.Q.S[2] = 'B'; 
            printf("%d",strlen(S.Q.S)); 
            return 0; 
        }
    • the program outputs 3
    • the program outputs 4
    • the program outputs 2
    • the program outputs 1
  16. What happens if you try to compile and run this program?

        #include <stdio.h> 
        struct Q { 
            int a,b,c; 
        }; 
        struct S { 
            int a,b,c; 
            struct Q Q; 
        }; 
        int main(void) { 
            struct Q Q = { 3,2,1 }; 
            struct S S = { 4,5,6 }; 
            S.Q = Q; 
            printf("%d",S.b - S.Q.b); 
            return 0; 
        }
    • the program outputs 1
    • the program outputs 4
    • the program outputs 2
    • the program outputs 3
  17. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <stdlib.h> 
        struct S { 
            int 	  a; 
            struct S *b; 
        }; 
        int main(void) { 
            struct S *x = (struct S*) malloc(sizeof(struct S)); 
            struct S *y = (struct S*) malloc(sizeof(struct S)); 
            x->a = 2; 
            x->b = y; 
            y->a = 4; 
            y->b = x; 
            printf("%d",x->b->b->b->a); 
            free(x); free(y);
            return 0; 
        }
    • the program outputs 1
    • the program outputs 4
    • the program outputs 3
    • the program outputs 2
  18. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <stdlib.h> 
        struct S { 
            int 	  a; 
            struct S *b; 
        }; 
        int main(void) { 
            struct S *x = (struct S*) malloc(sizeof(struct S)); 
            struct S *y = (struct S*) malloc(sizeof(struct S)); 
            struct S *p; 
            x->a = 2; x->b = y; 
            y->a = 4; y->b = x; 
            p = x; 
            p = p->b->b->b->b; 
            printf("%d",p->a); 
            return 0; 
        }
    • the program outputs 2
    • the program outputs 4
    • the program outputs 3
    • the program outputs 1
  19. What happens if you try to compile and run this program?

        #include <stdio.h> 
        struct S { 
            int a[2]; 
        }; 
        int main(void) { 
            struct S S[2]; 
            int i; 
            for(i = 0; i < 2; i++) 
            	S[i].a[1-i] = 4 * !i; 
            printf("%d",S[0].a[1]); 
            return 0; 
        }
    • the program outputs 2
    • the program outputs 4
    • the program outputs 1
    • the program outputs 3
  20. What happens if you try to compile and run this program?

        #include <stdio.h> 
        struct S { 
            char *p; 
        }; 
        int main(void) { 
            char *p = "abcd"; 
            struct S S[2]; 
            int i; 
            for(i = 0; i < 2; i++) 
            	S[i].p = p + i; 
            printf("%c",S[1].p[0]); 
            return 0; 
        }
    • the program outputs a
    • the program outputs d
    • the program outputs b
    • the program outputs c
  • 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.