Note

If you cannot find what you are looking for. Please visit our sitemap

Sunday, 8 May 2016

ICS Notes Computer Science Part 2 Chapter 8 Getting Started with C Short Questions

ICS Notes Computer Science Part 2 Chapter 8 Getting Started with C Short Questions


Q 1. What is computer program?
Ans. The set of instructions given to the computer to solve a specific problem is called computer program. Computer can solve problems with the help of computer program. Computer programs are written in programming languages.

Q 2. What is programming language?
Ans. Programming language is used to communicate with computer. All computer programs are written in programming languages. Every programming language has a set of alphabets and rules. The instructions of computer program are written by using the alphabets and rules defined by the programming language.

Q 3. List different types of programming language.
Ans. There are two types of programming languages.

  1. Low level languages
  2. High level languages


Q 4. What is high level language?
Ans. A programming language that is close to human language is called high level language. The instructions written in high level language look like English language sentences. High level languages are easy to learn and understand.

Q 5. What is low level language?
Ans. A language that is close to the language of computer. Computer itself uses this language is called a low level language. There are two types of low level languages.

  1. Machine language
  2. Assembly language


Q 6. What is machine language?
Ans. Machine language is also called binary language. There are only two alphabets of machine language those are zero (0) and one (1). Computer can understand only machine language. The programs written in other programming languages are first translated to machine language, and then used on computer. It is called the native language of computer.

Q 7. What is assembly language?
Ans. It is a programming language in which machine language instructions are replaced by english like words. These words are known as mnemonics. It is pronounced as Ne-Monic. An assembly language used english like words. It is easy to write a program in assembly language. It is mostly used for system software.

Q 7. What is source program?
Ans. A computer program written in high level language is called source program. Source program is also called source code.

Q 8. What is object program?
Ans. A computer program in machine language is called object program. Object program is also called object code. Machine language is native language of computer so object program directly runs on computer.

Q 9. What is language translator?
Ans. A language processor is a software that converts a program written in any programming language into machine language. Every language has its own processor. Language processor is also called language translator.

Q 10. What is compiler?
Ans. Software that converts a high level language program into machine language is called compiler. Every language has its own compiler. First a program is written in high level language. Then it is given to compiler. Compiler detects and tells about errors is programs. When high level language program is error free compiler converts it into machine language.

Q 11. What is interpreter?
Ans. It is a program that converts a source program into object program one statement at a time. It takes one statement of source program, translates it in machine code and executes it. After the execution of one statement, it takes next statement and repeat this process till the last instruction of program.

Q 12. What is assembler?
Ans. It is a language translator that converts a program written in assembly language into machine language.

Q 13. What is structured programming language?
Ans. In structured programming language the program is divided into parts or modules. These modules are combined to make a complete program. It is easy to write and debug a program written in structured programming language. There is less chance of error.

Q 14. What is unstructured programming language?
Ans. In unstructured programming language whole program consists of a single unit. It does not consist of parts or modules. It is difficult to write and debug a program written in unstructured programming language. There is more chance of error.

Q 15. What is preprocessor?
Ans. A compiler is a program that translates a high level language program into machine language. This process is called compilation. Preprocessor is a program that modifies a C program before compilation. Preprocessor directives are instructions for the preprocessor.

Q 16. What is preprocessor directive?
Ans. Preprocessor directives are instructions for the preprocessor. These instructions are written at the beginning of the program. Every preprocessor directive starts with # symbol. After # symbol "include" or "define" directives are used. Preprocessor directives are also called compiler directives.

Q 17. What is the work of include directive?
Ans. Include is a preprocessor directive. It is used to include header files in to the program. The relevant header file of the library function, we want to use in programs are mentioned at the beginning of program by using include directive.

Q 18. What is the work of define directive?
Ans. Define preprocessor directive is used to define a constant macro. Its general syntax is:

  • #define Macro-Name expression

Q 19. What is statement terminator?
Ans. Every C language statement ends with semicolon ";". Semicolon at the end of statement is called statement terminator.

Q 20. What are delimiters?
Ans. Curly braces at the beginning and end of the main function are called delimiters. C language statements are written between delimiters.

Q 21. What is main function?
Ans. Every C language program must contain a main() function. A program with out main function cannot be executed. Instructions of programs are written between the curly braces {} of main() function. These statements enclosed in main() function are called body of the main() function.

Q 22. What are bugs and debugging?
Ans. While writing a program the programmer may come across many errors. The error in a program is called bug. The process of finding and removing errors is called debugging.

Q 23. What is meant by creating a program?
Ans. Writing source code statements is called creating C program. Turbo C IDE can be used to create and edit program. First open Turbo C IDE. Then select new from file menu. A new edit window will be opened. The cursor blinks in the window. Cursor control keys can be used for cursor movements. We write the program statements in the window and save it as a program file.

Q 24. What is meant by editing a program?
Ans. Writing and editing source program is the first step. Source code is written in C language according to the type of the problem, in any text editor. Changing source code and removing errors in the program is called editing a program.

Q 25. What is meant by compiling a program?
Ans. Computer does not understand C language. It understands only machine language. So C language code is converted into machine language. The process of converting source code in to machine code is called compiling. Compiler is a program that compiles source code. If compiling is successful source program is converted into object program. Object program is saved on disk. The extension of file is ".obj".

Q 26. What is meant by linking a program?
Ans. The process of combining required library functions with object program is called linking. This is done with the help of a program called linker. It is a part of compiler. The linker combines object program produced by compiler and library function. It produces and saves a final machine language file. This file is called executable file. The extension of executable file is ".exe".

Q 27. What is meant by executing a program?
Ans. The process of running an executable file is called executing. After linking C program can be executed. A program loader is used to to transfer executable file from secondary storage to main memory. The program can be executed by selecting run from run menu bar of Turbo C IDE or by pressing Ctrl + F9 keys from keyboard.
Q 28. List name of some high level language.
Ans. High level languages

  • C
  • C++
  • C#
  • COBOL
  • BASIC
  • FORTRAN
  • PASCAL
  • JAVA


Q 29. What is Turbo C++?
Ans. Turbo C++ is an Integrated development environment (IDE) for creating C and C++ programs. Borland international has developed it. It is also called TC editor. It is used to create, edit and save programs. It also has powerful debugging features. These help us in finding and removing errors from a program. We can easily compile program. Linking a program is also very easy. It is also used to execute a program.

Q 30. What are necessary step to prepare a C program?
Ans. Step to prepare a C program
  • Creating & Editing
  • Saving
  • Compiling
  • Linking
  • Loading
  • Running


Q 31. What are header files?
Ans. Header files are part of C compiler. C language provides many built-in programs. Every program has a unique name. These programs are called built-in functions or library functions. Every library function can perform a specific task. We can use these library functions in our C language program. These functions are divided into groups according to their functionality. A group of same type of functions are stored in a same file. This file is called header file.

Q 32. What is C statement?
Ans. Every instruction written in C language program is called a C statement. Every statement ends with a semicolon ";". Semicolon is called statement terminator.

Q 33. What are syntax errors?
Ans. The rule for writing a program in a specific programming language is called syntax of the language. We must follow the syntax of a language. Syntax error occurs when the statements of program are not according to syntax. Compiler detects syntax errors. If there is a syntax error in program. It cannot be compiled successfully. Compiler tells about the location and type of syntax error. Syntax errors can be removed easily.

Q 34. What are logical errors?
Ans. The error that is due to wrong algorithm is called logical error. These errors occur due to the wrong logic of program. Compiler cannot detect these errors. A program having logical errors gives wrong results on execution. These errors are difficult to find, as compiler cannot detect these errors. The programmer should examine the whole program to find logical errors.

Q 35. What are runtime errors?
Ans. These errors occur during the execution of program are called runtime errors. When runtime error occur the execution of program stops and computer shows an error message. These errors occur when program wants to perform such task that computer cannot perform.

Q 36. What is ANSI C?
Ans. C language is very powerful and flexible language. Wide range of application programs are written in C language. American National Standard Institute (ANSI) made standard version of C language in late 1980s. This standard version of C is also called ANSI C. New version of C has many new features that were not available in older versions.

Q 37. List any four advantages of C language?
Ans. Advantages of C language

  • Easy to learn
  • Easy to Remove Errors
  • Machine Independence
  • Standard Syntax
  • Shorter Programs


Q 38. What is meant by machine independence?
Ans. A low level language program can run only on the type of computers for which it is written. So low level languages are machine dependent. A program written in high level language is machine independent. It can run on all types of computers.

Q 39. What is the difference between compiler and interpreter?
Ans. Software that converts a high level language program into machine language is called compiler. Every language has its own compiler. Compiler detects and tells about errors is programs. When high level language program is error free compiler converts it into machine language. So compiler is software that converts a source program into object program as a whole. Object code is used for execution.
It is a program that converts a source program into object program one statement at a time. It takes one statement of source program, translates it in machine code and executes it. Each time we execute a program by using its source code.

Written by: Asad Hussain

No comments:

Post a Comment