1. Question:What is a file? 

    Answer
    A file is a region of storage in hard disks or in auxiliary storage devices.It contains bytes of information .It is not a data type.

    1. Report
  2. Question:What is the use of a ‘\0’ character? 

    Answer
    It is referred to as a terminating null character, and is used primarily to show the end of a string value.

    1. Report
  3. Question:What are header files and what are its uses in C programming? 

    Answer
    Header files are also known as library files. They contain two essential things: the definitions and prototypes of functions being used in a program. Simply put, commands that you use in C programming are actually functions that are defined from within each header files. Each header file contains a set of functions. For example: stdio.h is a header file that contains definition and prototypes of commands like printf and scanf.

    1. Report
  4. Question:What are variables and it what way is it different from constants? 

    Answer
    Variables and constants may at first look similar in a sense that both are identifiers made up of one character or more characters (letters, numbers and a few allowable symbols). Both will also hold a particular value.  Values held by a variable can be altered throughout the program, and can be used in most operations and computations. Constants are given values at one time only, placed at the beginning of a program. This value is not altered in the program. For example, you can assigned a constant named PI and give it a value 3.1415  .  You can then use it as PI in the program, instead of having to write 3.1415 each time you need it.

    1. Report
  5. Question:Can you use “int” data type to store the value 32768? Why? 

    Answer
    No. “int” data type is capable of storing values from -32768 to 32767. To store 32768, you can use “long int” instead. You can also use “unsigned int”, assuming you don’t intend to store negative values.

    1. Report
  6. Question:What is the significance of an algorithm to C programming? 

    Answer
    Before a program can be written, an algorithm has to be created first. An algorithm provides a step by step procedure on how a solution can be derived. It also acts as a blueprint on how a program will start and end, including what process and computations are involved.

    1. Report
  7. Question:What is debugging? 

    Answer
    Debugging is the process of identifying errors within a program. During program compilation, errors that are found will stop the program from executing completely. At this state, the programmer would look into the possible portions where the error occurred. Debugging ensures the removal of errors, and plays an important role in ensuring that the expected program output is met.

    1. Report
  8. Question:What are preprocessor directives? 

    Answer
    Preprocessor directives are placed at the beginning of every C program. This is where library files are specified, which would depend on what functions are to be used in the program. Another use of preprocessor directives is the declaration of constants.Preprocessor directives begin with the # symbol.

    1. Report
  9. Question:How do you determine the length of a string value that was stored in a variable? 

    Answer
    To get the length of a string value, use the function strlen(). For example, if you have a variable named FullName, you can get the length of the stored string value by using this statement: I = strlen(FullName); the variable I will now have the character length of the string value.

    1. Report
  10. Question:What are the different file extensions involved when programming in C? 

    Answer
    Source codes in C are saved with .C file extension. Header files or library files have the .H file extension. Every time a program source code is successfully compiled, it creates an .OBJ object file, and an executable .EXE file.

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