1. Question:Which function in C can be used to append a string to another string? 

    Answer
    The strcat function. It takes two parameters, the source string and the string value to be appended to the source string.

    1. Report
  2. Question:What is the difference between functions getch() and getche()? 

    Answer
    Both functions will accept a character input value from the user. When using getch(), the key that was pressed will not appear on the screen, and is automatically captured and assigned to a variable. When using getche(), the key that was pressed by the user will appear on the screen, while at the same time being assigned to a variable.

    1. Report
  3. Question:What is the difference between text files and binary files? 

    Answer
    Text files contain data that can easily be understood by humans. It includes letters, numbers and other characters. On the other hand, binary files contain 1s and 0s that only computers can interpret.

    1. Report
  4. Question:What is dynamic data structure? 

    Answer
    Dynamic data structure provides a means for storing data more efficiently into memory. Using dynamic memory allocation, your program will access memory spaces as needed. This is in contrast to static data structure, wherein the programmer has to indicate a fix number of memory space to be used in the program.

    1. Report
  5. Question:What is the advantage of a random access file? 

    Answer
    If the amount of data stored in a file is fairly large, the use of random access will allow you to search through it quicker. If it had been a sequential access file, you would have to go through one record at a time until you reach the target data. A random access file lets you jump directly to the target address where data is located.

    1. Report
  6. Question:What are the advantages and disadvantages of a heap? 

    Answer
    Storing data on the heap is slower than it would take when using the stack. However, the main advantage of using the heap is its flexibility. That’s because memory in this structure can be allocated and remove in any particular order. Slowness in the heap can be compensated if an algorithm was well designed and implemented.

    1. Report
  7. Question:Create a simple code fragment that will swap the values of two variables num1 and num2. 

    Answer
    temp = num1; 
    num1 = num2; 
    num2 = temp;

    1. Report
  8. Question:What are reserved words? 

    Answer
    Reserved words are words that are part of the standard C language library. This means that reserved words have special meaning and therefore cannot be used for purposes other than what it is originally intended for. Examples of reserved words are int, void, and return.

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd