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 4 Assessment Exam Answers Full 100%

Last Updated on May 20, 2021 by Admin

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

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

        #include <stdio.h> 
        int main(void) { 
            int i = 3, j = i - 2; 
            switch(i - 2) { 
            case 1: j++; 
            case 2: j++; 
            case 0: j++; break; 
            default:j = 0; 
            } 
            printf("%d",j); 
            return 0; 
        }
    • the program outputs 3
    • the program outputs 2
    • the program outputs 1
    • the program outputs 4
  2. What happens if you try to compile and run this program?#include <stdio.h>

        #include <stdio.h> 
        #include <stdio.h> 
        int main(void) { 
            int i = 3, j = i - 2; 
    
            switch(i + 2) { 
            case 1: j++; 
            case 2: j++; 
            default:j = 0; 
            case 0: j++; break; 
            } 
            printf("%d",j); 
            return 0; 
        }

     

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

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

     

    • the program outputs 10
    • the program outputs 9
    • the program outputs 8
    • the program outputs 11
  4. What happens if you try to compile and run this program?

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

     

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

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

     

    • the program outputs -1
    • the program outputs 0
    • the program outputs 2
    • the program outputs 1
  6. What happens if you

    try to compile and run this program?

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

     

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

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

     

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

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

     

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

        #include <stdio.h> 
        int main(void) { 
            char t[] = { 'a', 'b', 'A', 'B' }; 
    
            printf("%d",t[1] - t[0] + t[3] - t[2]); 
            return 0; 
        }

     

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

        #include <stdio.h> 
        int main(void) { 
            float t[5] = { 1E0, 1E1, 1E2, 1E3, 1E4 }; 
        
            printf("%f",t[0] + t[2] + t[3]); 
            return 0; 
        }

     

    • the program outputs 1011.000000
    • the program outputs 1111.000000
    • the program outputs 1110.000000
    • the program outputs 1101.000000
  11. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            int i = 1, *j = &i, **k = &j; 
    
            printf("%d",**k); 
            return 0; 
        }

     

    • the program outputs 1
    • the program outputs NULL
    • the program outputs nul
    • the program outputs 0
  12. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            char t[3]; 
    
            printf("%d",sizeof(t) - sizeof(t[0])); 
            return 0; 
        }

     

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

        #include <stdio.h> 
        int main(void) { 
            int t[6]; 
    
            printf("%d",sizeof(t) / sizeof(int)); 
            return 0; 
        }

     

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

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

     

    • the program outputs 8
    • the program outputs 10
    • the program outputs 7
    • the program outputs 9
  15. What happens if you try to compile and run this program?

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

     

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

        #include <stdio.h> 
        int main(void) { 
            char s[] = "\0\1\2\3\4"; 
    
            printf("%c",'A' + s[3]); 
            return 0; 
        }

     

    • the program outputs A
    • the program outputs D
    • the program outputs B
    • the program outputs C
  17. What happens if you try to compile and run this program?

        #include <stdio.h> 
        int main(void) { 
            printf("%c","ACEGIK"[3] - 1); 
            return 0; 
        }
    • the program outputs E
    • the program outputs F
    • the program outputs G
    • the program outputs H
  18. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <string.h> 
        int main(void) { 
            char s[10] = "ABCDE"; 
    
            strcpy(s + 2, "ABCDE"); 
            printf("%d", s[0] - s[2]); 
            return 0; 
        }

     

    • the program outputs -1
    • the program outputs 0
    • the program outputs 1
    • the program outputs -2
  19. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <string.h> 
        int main(void) { 
            char s[10] = "CABDE"; 
    
            strcat(s + 2, "CABDE"); 
            printf("%d", s[0] - s[2]); 
            return 0; 
        }

     

    • the program outputs -1
    • the program outputs 1
    • the program outputs -2
    • the program outputs 0
  20. What happens if you try to compile and run this program?

        #include <stdio.h> 
        #include <string.h> 
        int main(void) { 
            char s[10] = "ABCDE"; 
    
            strcat(s + 2, "ABCDE"); 
            printf("%d", s[0] - s[2]); 
            return 0; 
        }

     

    • the program outputs 1
    • the program outputs -1
    • the program outputs 0
    • the program outputs -2
  • 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.