Posts

Showing posts with the label Class 10

Programming In C, Structure of C, Preprocessor Directives

Image
Question:  Write the structure of C. Ans : T he format according to which a program is written is called the  structure of program. The following is the structure of a C program. Structure of C Language Structure of C Language Question: What are preprocessor directives? Describe its main types. Ans:   Preprocessor directives are instructions for the c compiler. Every C language program contains preprocessor directives at the beginning of the program. These directives start with number sign(#). The most commonly used preprocessor directives are include and define. ** The include Preprocessor Directives When this preprocessor is carried out by the c compiler, it will search for the header file that is written within the less than(<) and greater (>) symbols and copy it into the source file. In the above program the header file stdio.h is used. The Define Preprocessor Directives The define preprocessor is used for defining constants in c programs. It directs the compile...

Programming in C, Reserved Words, Header File in C++

Image
 Question 1: What are reserved words? Why they should not be used as variable names ? Answer: The words that are part of programming language and have special purposes in computer programs are reserved words or keywords. They have predefined use and cannot be used for any other purpose. Reserved words are always written in lower case. There are 32 words defined as reserved words in C. Reserved Words Question 2. Describe the purpose of header files. Answer: C language contains a number of standard functions in library file that perform various tasks in c programs. These tasks include all the input/output operations and all the math operations. Library file contains header files and each header file contains a set of functions. Some commonly used header files are stdio.h, conio.h and math.h. Some commonly use functions that are included in stdio.h file are prinf(), scanf(), etc Header File

Programming In C, Linker, Loader and Debugger

Image
 Topic:  Programming In C Question: Describe the purpose of Linker, Loader and Debugger. Linker:  a linker is a computer program that takes one  or more object files generated by a compiler and  combines them into one or more executable programs. Object Code Loader:   A loader is the part of an operating system  that is responsible for loading programs and libraries.  It is one of the essential stages in the process of  starting a program Debugger:   It is a software that executes a program line by  line, examines the values stored in variables and helps in  finding and removing errors in programs.  Programming Basics. C is a popular and widely  used programming language for creating computer  programs. A large variety of application programs and  many operating system are written in C. The C language character set includes Letters:  C language comprises the following set of letters to form a standard p...

text editor, Language Translator, Source Code & Object Code, Compiler

Image
Question: What is a text editor? Ans: A text editor is a  simple word processor  that is used to create and  edit source code of  program. Files created  by a text editor are plain and text files. Text Editor Question: What is the d ifference between object code and the Source  code? Ans: Language Translator Source Code & Object Code Question:  What is a compiler, explain with the help of  a diagram? Ans :  A compiler is a computer software that translate C language program(source code) into machine code(object code) that can be understood and executed by the computer. It also detects syntax errors in the source program and gives hints to the programmer to correct them. A compiler will only create object program if all the syntax errors in a program have been corrected if they existed. Compiler https://www.youtube.com/watch?v=e4ax90XmUBc https://www.youtube.com/watch?v=ffovPJF86wU

Conditional Control structure. Chapter 4, Lab Activities, Long questions.

Image
  Chapter # 4 Conditional Control structure LAB ACTIVITIES                                LONG QUESTIONS               Question 1. Write a program that reads a number and prints its square if it is greater than 10. Ans: Program: #include<stdio.h> #include<conio.h> int main(int) {             int n;             printf(“\nEnter a number:”);             scanf(“%d”, &n);             if(n>10)             printf(“\nThe square of %d is %d”, n, n*n); getch(); } Output: Enter a number:12 The square of 12 is 144. Question 2. Write a program that reads t...

Conditional Control structure ,Short Questions, Computer Science

Chapter # 4 Conditional Control structure SHORT QUESTIONS Question 1. What is control statement? Ans: A control statement is an instruction which determine the sequence of execution of other statements. In other words, it controls the flow of execution of program of program statements.   Question 1. What is conditional statement? Ans : A conditional statement is an instruction in a programming language that contains a condition.   When a conditional statement is executed, first the condition is evaluated then based on the result (True or False) a particular statement or a set of statements is executed. Conditional statements of c language are : if, if-else, else-if and switch statements.   Question 3. Explain the syntax and purpose of if statement with the help of a computer program? Ans : The if statement has the following general form. if(condition) { Block of statements } When this statement is executed the condition is evaluated. If the co...