36 Question : What is Type Declaration Statement in C?
In the instruction a group of variables with a specific data type are declared in a program which are further used in that program. In C any variable must be declared before using it in a program. This type of instruction is normally written at the beginning.
int m1, m2, m3;
float sal, da, hra;
char ch;
long x, y;
unsigned int a, b;
37 Question : What is Expression Statement?
Expression statements cause expressions to be evaluated. There will be no transfer of control or iteration takes place as a result of an expression statement. The general syntax for the expression statement is
[expression];
All expression in an expression statement are evaluated before the next statement is executed. The most common expression statements are assignments, function calls, increment or decrement statements etc.
38 Question : Explain Input / Output Statements in C.
In order to make a program interactive, the programmer requires certain statements called input output statements. C provides standard functions scanf() and printf(), for performing formatted input and output. These functions accepts, as parameters, a format specifications string and a list of variables.
The format specifications string is a character string that specifies the data type of each variable to be input or output and the size or width of the input and output.
39 Question : What is Selection Statements in C.
In this control structure there is an execution of a group of instructions depending upon the result of a decision. There is also a special kind of branching called selection in which one group of statements is selected from several available groups.
Decision control structure in C can be implemented using:
- if Statement
- if-else Statement
- Nested if-else Statement
- else-if Ladder
- Case Control Structure
- Conditional Operator (?)
40 Question : What is Iteration Statement.
Many problems require that a set of statements should be executed more than one time, each time changing the value of one or more variables, so that every executions is different from the previous one. This kind of repetitive execution of a set of statements in a program is known as interactive loop.
Looping involves repeating some portion of the program either a specified number of times or until a particular condition is being satisfied. There are three methods by which looping can be done in a program:
- while Statement
- for Statement
- do-while Statement
41 Question : Differentiate between constant and variable.
S.No. | Constant | Variables |
---|---|---|
1 | Constant does not change during the execution of the program. | Variables varies during the execution of the program. |
2 | Constant is quantity which is fixed. Constant may be numbers, characters or strings. | Variable is name given to memory location where constant is stored. |
3 | It does not store in a memory. | It stores in a memory locations. |
4 | In an Statement Z = 3.2*X+5*Y+19 3.2,5 and 19 more constants | In a Statement Z= 3.2*X+5*Y+19 X,Y,Z are variables |
42 Question : Define Indentifier.
Identifiers are the names given to various elements of program such as variables, functions, arrays, structures, unions etc. They have same rules to construct as the rules for constructing variables names. Both uppercase and lowercase letters can be used but have different meaning. e.g. area, average, sum, MARKS, etc are all valid identifiers, whereas 6th, basic-pay, are invalid identifiers because they all have invalid character in it.
43 Question : Explain Library Functions.
The C Language is equipped with a number of library functions that are used to carry out various operations and calculations. Some of the functions return a data item, others indicate whether a condition is true or false by returning 1 or 0 respectively and some other functions do specific operations but do not return anything.
Library Functions are built-in functions and are stored in a special library file and are available with C compiler.