Very short question and answer from C programming for SEE and grade 10 students
(It carries 1 Mark)
Answer the
following questions in short.
1) List any two types of data types used in C
language. (Specification Grid 2077, SEE Grade promotion exam 2078, SEE 2079) (Spec.
grid 2065, SLC 2065, supp. 2065, 2066, SLC 2068, 2070, supp. 2070, SEE 2072,
2074)
Ans: Data types used in C language are:
i) Integer (int)
ii) String (chr)
iii) Float (float)
iv) Long integer (double)
2) Write any two advantages of structured
programming.(SLC 2066)
Ans: Following are the two
advantages of structured programming:
· Easy to debug.
· More reliable
· It is program oriented.
3) Write any two characteristics/features of
C language. (SLC 2067, 2069, 2071, SEE
2073 Supp, Specification Grid 2077)
OR
Write any two advantages of structure
programming. (SEE
2075)
Ans: The characteristics of C language are
as follows:
· It has enough numbers of in-built functions and operators.
· It has verity of data types to represent different kind of data.
· It is a bridge between high level and low-level language.
4) What is C programming?
Ans: C is a powerful and versatile general-purpose
programming language known for its efficiency and direct access to hardware.
5) Write the difference between QBASIC and C language.
Ans: The difference between QBASIC and C
language are as follows:
QBASIC |
C |
a) It is a high-level programming language. |
a) It is a high-level programming language with the features of a low-level programming language. |
b) It is a general programming language | b) It is a system programming language. |
c) It supports limited data type. |
c) It supports a wide range of data types. |
d) It supports both sub-procedure and function procedures. |
d) It supports only function procedures. |
6) What is character set? List the different
character set used in C.
Ans: The character set consists of
alphabet digit or special symbol used to represent information.
Character set used in C are as
follows:
Alphabets |
Uppercase (i.e A,B, ……….Y,Z) or Lowercase (i.e. a,b,…………y,z) |
Digits |
0,1,2,………….8,9 |
Special
symbol |
+, -, *, /, =, ( ), [ ], <>, ‘, “, !, #, %, &, _, |, ^, ~, \, ., ;, “, ? |
White space characters |
Blank space, new line, tab etc.. |
7) What is keyword? List the different
keyword of C.
Ans: Keywords are words whose meaning has
already been explained to the compiler or the computer. There are about 32
keywords in C and they are as here under:
Auto |
Double |
If |
Static |
Break |
Else |
Int |
Struct |
Case |
Enum |
Long |
Switch |
Char |
Extern |
Near |
Typedef |
Const |
Float |
Register |
Union |
Continue |
For |
Return |
Unsigned |
Default |
Far |
Short |
Void |
do |
goto |
signed |
While |
8) What is a header file?
Ans: A header file is a standard file that
contains definitions of variables and functions that are necessary for the
functioning of a program.
9) Write any four examples of header files in 'C' Programming.
Ans: <stdio.h>, <conio.h>,
<string.h>, <math.h> are the examples of header files.
10) What are the similarities in QBASIC and C language.
Ans: The following are the similarities in QBASIC and C language:
- Both languages are used to develop structured programs.
- Both languages support local and global variables.
- Both languages support procedures.
11) What is identifier?
Ans: Identifiers can be defined as the
name of the variables, functions, array, structure created by the programmer.
12) What is operator in C? List the different
types of operators available in C.
Ans: Operators are the special symbol that
perform certain action on one and more than one value or variable and generate
the output. Following are the operators supported by C.
- Arithmetic operators
- Relational operators
- Logical operators
- Unary operator or Increment and decrement operators
13) What is variable? (SEE
2073)
Ans: The data item whose value changes during the execution of a program is called variable.
14) What is structure programming? Give examples
Ans: Structured programming (sometimes known
as modular programming) is a programming paradigm that facilitates
the creation of programs with readable code and reusable components. Examples:
Pascal and 'C'.
15) Why 'C' is called a structure programming?
Ans: C is called a structured programming language
because to solve a large problem, C programming language divides the problem
into smaller structural blocks each of which handles a particular
responsibility
16) Write the header files and their functions
with examples.
Ans: Following are the header files used in 'C'
programming.
Header files |
Functions |
Supported commands |
<stdio.h> |
It is a standard input output header file. It contain the function definition of input output functions. |
printf(), scanf(), gets(), puts() etc. |
<conio.h> |
It is used to console input output. |
getch(), clrscr() etc. |
<string.h> |
It is used to string processing functions. |
Strlen(), strcpy(). strlwr(), strcat(), strcmp() etc |
<math.h> |
It is used to solve the mathematical calculation. |
Sqrt(), sin(), cos(), pow(),log() etc. |
<graphics.h> |
It is used to process the graphics functions. |
line(), circle(), rectangle() etc. |
17) Define constant. List its types.
Ans: Constant are the values which remain
unchanged during program execution. C constant can be classified into two
components.
a) Primary
constant: Eg. Integer, real, character
and string
b) Secondary
Constant: Eg. Array, pointer, union, structure etc..
18) What is Data type?
Ans: Data types refer to the type of data or
variable which is to be stored and used in the program.
19) What is format specifier?
Ans: Format specifiers can be defined as the
operators which are used in association with printf() function for printing the
data that is referred by any object or any variable.
20) List any four format specifier used in 'C'
programming.
Ans: Following are the format secifier used in 'C' programming.
Data
types |
Format
specifiers symbol |
Integer |
%d |
float
(simple) |
%f |
Character |
%c |
String |
%s |
21) What is a control statement? List its
examples.
Ans: Control statements enable us to specify the flow of program control; ie, the order in which the instructions in a program must be executed.
Following are the types of control statements.
- Selection / decision statements (if, switch)
- Iteration/looping statement. (for, while)
- Jumping statement. (break, continue, return)
22) What is decision statement?
Ans: Decision-making statements are the statements that
are used to verify a given condition and decide whether a block of statements
gets executed or not based on the condition result.
23) What is switch statement in 'c'?
Ans: A switch statement allows a variable
to be tested for equality against a list of values. Each value is called a
case, and the variable being switched on is checked for each switch case.
24) What do you mean by looping? List examples
of looping in 'C'
Ans: A loop statement allows us to execute a statement or group of statements multiple times. Examples: for lop, while loop, do.....while loop
25) What is unary operator?
Ans: Unary operators are those operators which
needs only one operand to perform an operation. These operators are usually
written on left of variables or objects but sometimes can be written on right
as well.
Operator Name |
Symbol |
Example |
Post-increment |
<variable> ++ |
x++ means x=x+1 |
Post-decrement |
<variable> -- |
x-- means x=x-1 |
Pre-increment |
++<variable> |
++x means x=x+1 |
Pre-decrement |
-- <variable> |
--x means x=x-1 |
26) What is arithmetic operators? Give examples.
Ans: The Arithmetic operators are some of the C Programming
Operator, which are used to perform arithmetic operations includes operators
like Addition, Subtraction, Multiplication, Division and Modulus. Examples: +,
-, *, /, %
27) What is relational operator? Give examples.
Ans: The symbols which are used to check the
relationship between two variables is known as relational operators. Examples:
<,>,>=,<=,==,!=
28) What do you mean by logical operators? Give
example.
Ans: Logical
Operators are used to combine two or more conditions/constraints or to
complement the evaluation of the original condition in consideration.
Examples: &&, ||,
!
29) What is counter?
Ans: Counter
is a variable which controls the loop statement and provides the track to run
the loop statement in certain number times.
SEE Class 10 Computer Science Model Set
No comments:
Post a Comment