Posts

Showing posts with the label Short Questions

Programming in C, Variables, Numeric Variable, Character Variable.

Image
Question 1: Describe the purpose of variables. Ans:   A variable is a symbolic name that represents a value  that can change during execution of a program. A variable  has a name, known as variable name and it hold data of  other types. These are called memory  locations. Variables are of two types. 1.  Numeric Variable 2.  Character Variable Variables Question 2: What is the difference between  numeric and character  variable? Ans:   Numeric variables  are used to represent numeric values in computer programs. e.g: sum, avg, marks, etc Character variables  represent character values in computer program. It can represent a single character or a string of characters. e.g: city, gender etc.

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...