Type Here to Get Search Results !

SEBA Class 9 Computer Science Chapter 8: Introduction To C Programming All Questions & Answers

SEBA Class 9 Computer Science Chapter 8: Introduction To C Programming All Questions & Answers


Introduction To C Programming


1. Fill in the blanks :-

1) C is the only high-level programming language FALSE (TRUE/FALSE)

2) IDE stands for Integrated Development Environments

3) We always need a very powerful computer to run C programs FALSE (TRUE/FALSE)

4) Every statement in a C program has to end with Semicolon (;)

5) Execution of program starts from main ()



2. Short answer questions :- (Answers should preferably be of 2-3 lines)

1) While writing a computer program, what does a programmer need to assure about the CPU and storage.

Ans :- While writing the computer program, the program writer should make sure about
the calculation or processing element (i.e CPU) and a have a sufficient/huge memory (the place where the data is to be stored). The programmer must also need to make sure that processing element should process one instruction after the other in order.

 
2) Do we always need Code block to write C programs? Explain.

Ans :- Yes, we always need of Code block to write the programs in C, as it belongs to one of the IDEs (Integrated Development Environment) which combines both text editor and compiler to provide other results.


3) Why do we need header files? Name a few standard header files in C.

Ans :- We make use of header files in C, because it provides support for standard input or output operations. Some of few standard header files in C are stdio.h, conio.h, stdlib.h, math.h, string.h etc.

 

3. Long answer questions (Answers should preferably be of 5-6 lines)

1) Explain the process of compilation of a C program. When we save a C program with the file name Namaskar.c, what files will be created at each step of compilation.

Ans :- The steps/process of compilation of a C program is represented with the help of the diagram :

  • The first step (Preprocessing) :- The work of the compiler is to remove the lines which are commented (written down just for understanding purpose) in the program. The header files in the programs are expanded and other few works are also done. If the source code of a file is Prog 1.c , then this step produces the output.
  • The second step (Compiler) :- In this step, the file is being compiled and converted into assembly language.
  • The third step (Assembler) :- On the basis ISA of the computer, the assembly code is generated. The generated assembler language code Prog 1.s is been converted into machine language code Prog 1.o, which is called as the object files.
  • The fourth step/last step (Linker) :- Different object files are linked, if incase one object file requires another other object file for the execution. From the source code that we written, we get the output as executable file. The operating system runs this executable file, and hence we get to see the desired results/output of the program.

2) Can we compile an erroneous code in C? If we do not write the function main () in our C program will it compile successfully?

Ans :- We can compile an error code in C. No, we can’t compile a C program without main () function as if at the time of execution of the program, the program will not be executed. The execution of each program starts from the main () function only. It is impossible to skip main () function while writing the program because of the following points :-
  • a) It’s an entry /starting point of every C program
  • b) With the help of main() function all the predefined or user defined functions are directly/indirectly called.
 
3) What is a programmer’s view of memory? Is it different from actual memory? Explain briefly.

Ans :- While writing computer program, the programmer must be sure about the
calculation or processing element (i.e CPU) and a huge /sufficient memory, to store the
data. It is called programmer’s view of memory. Below is the


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad

Subscribe Us