Preview

Nt1310 Unit 3 Quiz

Good Essays
Open Document
Open Document
6337 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Nt1310 Unit 3 Quiz
/*question number 1*/ Code: int z,x=5,y=-10,a=4,b=2; z = x++ - --y * b / a; What number will z in the sample code above contain? Choice 1 5 Choice 2 6 Choice 3

10 [Ans] Corrected by buddy by running the program Choice 4 11 Choice 5 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*question number With every use of release allocated Choice 1 unalloc() Choice 2 dropmem() Choice 3 dealloc() Choice 4 release() Choice 5 free() [Ans] - - - - - - - - 2*/ a memory allocation function, what function should be used to memory which is no longer needed?

- - - - - - - - - - - - - - - - - - - - - - - - - - -

/*question number 3*/ Code: void *ptr; myStruct myArray[10]; ptr = myArray; Which of the following is the correct
…show more content…
What is the primary purpose of the __P() macro? Choice 1 The __P() macro has no function, and merely obfuscates library function declarat ions. It should be removed from further releases of the C library. Choice 2 The __P() macro provides forward compatibility for C++ compilers, which do not r ecognize Standard C prototypes. Choice 3 Identifiers that begin with two underscores are reserved for C library implement ations. It is impossible to determine the purpose of the macro from the context given. Choice 4 The __P() macro provides backward compatibility for K&R C compilers, which do no t recognize Standard C prototypes. Choice 5 The __P() macro serves primarily to differentiate library functions from applica tion-specific functions. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*question number 68*/ Which one of the following is NOT a valid identifier? Choice 1 __ident Choice 2 auto [Ans] Choice 3 bigNumber Choice 4 g42277 Choice 5 peaceful_in_space - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /*question number 69*/ /* Read an arbitrarily long string. */ Code: int read_long_string (const char ** const buf) { char * p = NULL; const char * fwd = NULL; size_t len = 0; assert(buf); do { p = realloc(p, len += 256); if (!p) return 0; if (!fwd) fwd = p; else fwd = strchr(p, '\0'); } while (fgets(fwd, 256, stdin)); *buf =

You May Also Find These Documents Helpful

  • Powerful Essays

    4. The calculation should be executed only after all the valid input values are provided.…

    • 1488 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Nt1210 Chapter 1 Review

    • 1315 Words
    • 6 Pages

    7. A user has opened a calculator application, typed the numbers 123456789, and then done some math problem using this number. Which of the following determine, in part, what bits the computer store in RAM to represent the number123456789?…

    • 1315 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Quiz Comp Archi

    • 438 Words
    • 3 Pages

    13) For each of the following 6-bit operations, calculate the values of the C, Z, V, and N flags in the ARM.…

    • 438 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    B. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode.…

    • 761 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    A. Program Design – Following the directions in the assignment, clearly write up your problem design in this section and comment your pseudocode.…

    • 467 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Sheet01

    • 1045 Words
    • 5 Pages

    4. What is the result of the following code and where is it kept? LDAA #$15 ADDA #$13 5. Which of the following instructions is (are) illegal? a- LDAA #500 b- LDAA #50 c- LDAA #00 d- LDAA #$255 e- LDAA #$25 f- LDAA #$F5 g- ADDA mybyte , #$25 6. Which of the following instructions is (are) illegal? a- ADDA #$300 b- ADDA #$50 c- ADDA #$500 d- ADDA #$255 e- ADDA #12 f- ADDA#$F5 g- ADDA #$25 7. 8. 9. 10. Show a simple code to load values 30H and 97H into locations 805H and 806H, respectively. Show a simple code to load value 55H into locations 300H and 308H. Show a simple code to load value 5FH into Port B. Which of the following is an invalid use of the immediate addressing mode? a- LDDA #$24 b- LDAA $30 c- LDAA #$60…

    • 1045 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    carloe :)

    • 253 Words
    • 2 Pages

    Problem 1. a) Write an application that can hold five integers in an array. Display the integers from first to last, and then display the integers from last to first.…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    it320 assignment 1-3

    • 1779 Words
    • 8 Pages

    7. A user has opened a calculator application, typed the numbers 123456789, and then done some math problem using this number. Which of the following determines, in part, what bits the computer (D. the binary equivalent of decimal 123456789)…

    • 1779 Words
    • 8 Pages
    Good Essays
  • Good Essays

    Living Your Dreams

    • 59499 Words
    • 238 Pages

    Preface Preface to the first edition Introduction 1. Chapter 1: A Tutorial Introduction 1. Getting Started 2. Variables and Arithmetic Expressions 3. The for statement 4. Symbolic Constants 5. Character Input and Output 1. File Copying 2. Character Counting 3. Line Counting 4. Word Counting 6. Arrays 7. Functions 8. Arguments - Call by Value 9. Character Arrays 10. External Variables and Scope 2. Chapter 2: Types, Operators and Expressions 1. Variable Names 2. Data Types and Sizes 3. Constants 4. Declarations 5. Arithmetic Operators 6. Relational and Logical Operators 7. Type Conversions 8. Increment and Decrement Operators 9. Bitwise Operators 10. Assignment Operators and Expressions 11. Conditional Expressions 12. Precedence and Order of Evaluation 3. Chapter 3: Control Flow 1. Statements and Blocks 2. If-Else 3. Else-If 4. Switch 5. Loops - While and For 6. Loops - Do-While 7. Break and Continue 8. Goto and labels…

    • 59499 Words
    • 238 Pages
    Good Essays
  • Satisfactory Essays

    HW2 C

    • 142 Words
    • 1 Page

    Q2: Write a function that takes an integer m as a parameter then return the following…

    • 142 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Q2 Choose the appropriate option for the following sentences I. ---------- a fixed length block on main memory. (frame, page ,partition ,hole) II.…

    • 305 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    * The true programmer's model of any processor shows its internal registers, number of address lines, number of data lines, memory map & port addresses which we need to write programs.…

    • 567 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    How is it detected ? 3. Explain with suitable examples the need for the following addressing Modes ; a) Index b) Indirect c) Autoincrement d) Autodecrement 1.…

    • 1106 Words
    • 5 Pages
    Good Essays
  • Better Essays

    c++ balaguruswamy

    • 1703 Words
    • 22 Pages

    Top of Form Technical Interview Questions Google Search C++ Interview Questions C# Interview Questions C Interview Questions ......... More pub-7003540323 ISO-8859-1 active GALT:#008000;G C ++ Aptitude Questions C Aptitude Questions 2 ......... More 3422992112 ISO-8859-1 Aptitude Interview Questions 1 en Bottom of Form Tutorials C Tutorial C++ Tutorial C Aptitude Questions and Answers…

    • 1703 Words
    • 22 Pages
    Better Essays
  • Satisfactory Essays

    C coding

    • 384 Words
    • 2 Pages

    1. The codes are written in C language compiled in a virtual machine (gcc -lpthread -o soft soft.c).…

    • 384 Words
    • 2 Pages
    Satisfactory Essays