Zeal Education Society’s
ZEAL POLYTECHNIC, PUNE.
NARHE │PUNE -41 INDIA
FIRST YEAR (FY)
DIPLOMA IN COMPUTER ENGINEERING
SCHEME: I SEMESTER: II
NAME OF SUBJECT: PROGRAMMING IN C
Subject Code: 22226
MSBTE QUESTION PAPERS & MODEL ANSWERS
1. MSBTE SUMMER-18 EXAMINATION
2. MSBTE WINTER-18 EXAMINATION
3. MSBTE SUMMER-19 EXAMINATION
4. MSBTE WINTER-19 EXAMINATION
22226
[1 of 4] P.T.O.
21718
3 Hours / 70 Marks Seat No.
Instructions : (1) All Questions are compulsory.
(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Mobile Phone, Pager and any other Electronic Communication
devices are not permissible in Examination Hall.
(7) Preferably, write the answers in sequential order.
Marks
1. Attempt any FIVE of the following : 10
(a) Define :
(i) Two dimensional array
(ii) Multi-dimensional array
(b) Give any four advantages of pointer.
(c) Define type casting. Give any one example.
(d) State any four decision making statements.
(e) State any four math functions with its use.
(f) State the use of following symbols used for flowchart drawing :
(i)
(ii)
(iii) (iv)
(g) State use of while loop with syntax.
22226 [2 of 4]
2. Attempt any THREE of the following : 12
(a) Develop a simple ‘C’ program for addition and multiplication of two integer
numbers.
(b) Explain how to pass pointer to function with example.
(c) Explain following functions :
getchar( )
putchar( )
getch( )
putch( )
with suitable examples.
(d) Develop a program to accept an integer number and print whether it is
palindrome or not.
3. Attempt any THREE of the following : 12
(a) State the use of printf( ) & scanf( ) with suitable example.
(b) Explain any four library functions under conio.h header file.
(c) Explain how formatted input can be obtain, give suitable example.
(d) Develop a program to find factorial of a number using recursion.
22226 [3 of 4]
P.T.O.
4. Attempt any THREE of the following : 12
(a) Write a program to sweep the values of variables a = 10, b = 5 using function.
(b) Develop a program using structure to print data of three students having data
members name, class, percentage.
(c) Design a program to print a message 10 times.
(d) Draw a flowchart for checking whether given number is prime or not.
(e) Implement a program to demonstrate logical AND operator.
5. Attempt any TWO of the following : 12
(a) Draw a flowchart of Do-while loop and write a program to add numbers until
user enters zero.
(b) Give a method to create, declare and initialize structure also develop a
program to demonstrate nested structure.
(c) Implement a program to demonstrate concept of pointers to function.
6. Attempt any TWO of the following : 12
(a) Develop a program to swap two numbers using pointer and add swaped
numbers also print their addition.
(b) Design a programme in C to read the n numbers of values in an array and
display it in reverse order.
(c) Develop a program to find diameter, circumference and area of circle using
function.
_______________
22226 [4 of 4]
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 1 / 16
22226
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the model
answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to
assess the understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance
(Not applicable for subject English and Communication Skills).
4) While assessing figures, examiner may give credit for principal components indicated in the
figure. The figures drawn by candidate and model answer may vary. The examiner may give
credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant
values may vary and there may be some difference in the candidate‟s answers and model
answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant
answer based on candidate‟s understanding.
7) For programming language papers, credit may be given to any other program based on
equivalent concept.
Q.
No
.
Sub
Q.N.
Marking
Scheme
1.
(a)
Ans.
10
2M
Definitio
n of two-
dimensi
onal
array
1M
Multi-
dimensi
onal
array
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 2 / 16
22226
(b)
Ans.
2M
Any
four
advanta
ges ½M
each
(c)
Ans.
2M
Definitio
n of type
casting
1M
Any one
correct
Example
1M
(d)
Ans.
2M
Any
four
correct
decision
making
statemen
ts - ½ M
each
(e)
Ans.
2M
Any
four
correct
math
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 3 / 16
22226
function
with its
use ½M
each
(f)
Ans.
2M
Correct
use of
symbols
½M
each
(g)
Ans.
2M
Use of
while
loop 1M
Syntax
of while
loop 1M
2.
(a)
Ans.
12
4M
Correct
Logic
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 4 / 16
22226
Correct
syntax
2M
(b)
Ans.
4M
Explana
tion 2M
Example
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 5 / 16
22226
(c)
Ans.
4M
Explana
tion of
each
function
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 6 / 16
22226
(d)
4M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 7 / 16
22226
Ans.
Correct
Logic
2M
Correct
syntax
2M
3.
(a)
Ans.
12
4M
Explana
tion of
printf,
scanf
1M each
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 8 / 16
22226
Example
2M
(b)
Ans.
4M
Any 4
function
1M each
(c)
Ans.
4M
Explana
tion 2M
Example
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 9 / 16
22226
(d)
Ans.
4M
Correct
syntax
2M
Correct
logic 2M
4.
(a)
Ans.
12
4M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 10 / 16
22226
Correct
syntax
2M
Correct
logic 2M
(b)
Ans.
4M
Correct
syntax
2M
Correct
logic 2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 11 / 16
22226
(c)
Ans.
4M
Correct
syntax
2M
Correct
logic 2M
(d)
Ans.
4M
Correct
symbols
1M
Correctn
ess of
flowchar
t 3M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 12 / 16
22226
(e)
Ans.
4M
Correct
Syntax
2M
Correct
logic 2M
5.
(a)
Ans.
12
6M
Correct
Flowcha
rt 3M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 13 / 16
22226
Correct
program
3M
(b)
Ans.
6M
Creation
,
declarati
on 2M
Initializ
ation
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 14 / 16
22226
Program
3M
(c)
Ans.
6M
Correct
logic 3M
Correct
syntax
3M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 15 / 16
22226
6.
(a)
Ans.
12
6M
Correct
logic for
swappin
g using
pointer
4M
Correct
logic for
addition
&
display
2M
(b)
Ans.
6M
Correct
logic for
input
array
3M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
MODEL ANSWER
SUMMER 2018 EXAMINATION
Subject: Programming in ‘C’ Subject Code:
Page 16 / 16
22226
Correct
logic to
display
in
reverse
3M
(c)
Ans.
6M
Correct
logic
using
function
to find
diameter
2M,circ
umferen
ce 2M,
area 2M
22226
[1 of 4] P.T.O.
11819
3 Hours / 70 Marks Seat No.
Instructions : (1) All Questions are compulsory.
(2) Illustrate your answers with neat sketches wherever necessary.
(3) Figures to the right indicate full marks.
(4) Assume suitable data, if necessary.
(5) Mobile Phone, Pager and any other Electronic Communication devices
are not permissible in Examination Hall.
(6) Preferably, write the answers in sequential order.
Marks
1. Attempt any FIVE of the following : 10
(a) Define Algorithm.
(b) Give the significance of <math.h> and <stdio.h> header files.
(c) Give syntax of if-else ladder.
(d) Define Array.
(e) Write syntax and use of pow( ) function of <math.h> header file.
(f) Define pointer. Write syntax for pointer declaration.
(g) Draw and label symbols used in flow chart.
22226 [2 of 4]
2. Attempt any THREE of the following : 12
(a) Write an algorithm to determine whether a given number is divisible by 5 or
not.
(b) Explain do – while loop with example.
(c) Explain one dimension and two dimension arrays.
(d) Write the output of following c program
#include<stdio.h>
int main ( )
{
char *ptr;
char str[]=“MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION”;
ptr=str;
ptr=ptr+11;
printf(“%s”,++ptr);
return 0;
}
3. Attempt any THREE of the following : 12
(a) Explain increment and decrement operator.
(b) Explain User defined function with example.
(c) Explain conditional operator with example.
(d) Explain strlen( ) and strcpy( ) function with example.
22226 [3 of 4]
P.T.O.
4. Attempt any THREE of the following : 12
(a) Write algorithm and draw flow-chart to print even numbers from 1 to 100.
(b) Write a program to accept marks of four subjects as input from user. Calculate
and display total and percentage marks of student.
(c) Write a program to accept the value of year as input from the keyboard &
print whether it is a leap year or not.
(d) Write a program to accept a string as input from user and determine its length.
[Don’t use built in library function strlen( )]
(e) Write a program to swap two numbers using call by value.
5. Attempt any TWO of the following : 12
(a) Write a program using switch statement to check whether entered character is
VOWEL or CONSONANT.
(b) Write a program for addition of two 3 3 matrices.
(c) Write a program to Print values of variables and their addresses.
6. Attempt any TWO of the following : 12
(a) Write a program to declare structure employee having data member name,
age, street and city. Accept data for two employees and display it.
(b) If the value of a number (N) is entered through keyboard. Write a program
using recursion to calculate and display factorial of number (N).
(c) Write a program to accept two numbers from user and perform addition,
subtraction, multiplication and division operations using pointer.
_______________
22226 [4 of 4]
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 1 / 16
22226
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the model
answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to
assess the understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance
(Not applicable for subject English and Communication Skills).
4) While assessing figures, examiner may give credit for principal components indicated in the
figure. The figures drawn by candidate and model answer may vary. The examiner may give
credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant
values may vary and there may be some difference in the candidate’s answers and model
answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant
answer based on candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on
equivalent concept.
Q.
No
.
Sub
Q.N.
Marking
Scheme
1.
(a)
Ans
10
2M
Correct
Definitio
n 2M
(b)
Ans
2M
Signific
ance of
each 1M
(c)
Ans
2M
Correct
syntax
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 2 / 16
22226
(d)
Ans
2M
Definitio
n of
array
2M
(e)
Ans
2M
Syntax
and use
of pow()
1M each
(f)
Ans
2M
Definitio
n of
pointer
1M,
Syntax
1M
(g)
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 3 / 16
22226
Ans
Any
Four
Symbols
½ M
each
2.
(a)
Ans
12
4M
Correct
algorith
m 4M
(b)
Ans
4M
Explana
tion 2M,
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 4 / 16
22226
Any
relevant
Example
2M
(c)
Ans
4M
Explana
tion of
one
dimensi
onal and
two
dimensi
onal
array
2M each
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 5 / 16
22226
(d)
Ans
4M
Correct
output
4M
3
(a)
Ans
12
4M
Explana
tion of
each
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 6 / 16
22226
(b)
Ans
4M
Explana
tion with
general
syntax
2M
Example
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 7 / 16
22226
(c)
Ans
4M
Explana
tion 2M
Example
2M
(d)
Ans
4M
Explan
ation &
Exampl
e of
each
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 8 / 16
22226
4
(a)
Ans
12
4M
Algorith
m 2M
Flowcha
rt 2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 9 / 16
22226
(b)
Ans
4M
Relevant
logic
2M
Syntax
2M
start
Initialize variable i=1
Is i <=100?
Is i%2==0?
Print i
i=i+1
NO
NO
YES
stop
YES
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 10 / 16
22226
(c)
Ans
4M
Correct
Logic
2M
Correct
Syntax
2M
(d)
Ans
4M
Correct
Logic
2M
Correct
Syntax
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 11 / 16
22226
(e)
Ans
4M
Correct
Logic
2M
Correct
Syntax
2M
5
(a)
Ans
12
6M
characte
r input-
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 12 / 16
22226
Display
vowel-
2M
Display
consona
nt
2M
(b)
Ans
6M
Input of
two
matrices
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 13 / 16
22226
Addition
of
matrices
2M
Display
of
addition
2M
(c)
Ans
6M
Display
values
of
variable-
3M
Display
address
of
variable
3M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 14 / 16
22226
6
(a)
Ans
12
6M
Declarat
ion of
structur
e-2M
Acceptin
g data-
2M
Displayi
ng
data2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 15 / 16
22226
(b)
Ans
6M
Main
function
definitio
n-3M,
Recursiv
e
function
definitio
n-3M
(c)
Ans
6M
Acceptin
g
numbers
1M
Pointer
initializa
tion-1M
Addition
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2018 EXAMINATION
MODEL ANSWER
Subject: Programming in C Subject Code:
Page 16 / 16
22226
subtracti
on-1M
multiplic
ation-
1M
division-
1M
22226
[1 of 2] P.T.O.
21819
3 Hours / 70 Marks Seat No.
Instructions : (1) All Questions are compulsory.
(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Use of Non-programmable Electronic Pocket Calculator is permissible.
Marks
1. Attempt any FIVE of the following : 10
(a) Draw flowchart for checking whether given number is even or odd.
(b) List any four keywords used in ‘C’ with their use.
(c) Write the syntax of switch case statement.
(d) State any two differences between while and do-while statement.
(e) State difference between array and string.
(f) Declare a structure student with element roll-no and name.
(g) Distinguish between call by value and call by reference.
2. Attempt any THREE of the following : 12
(a) State four arithmetic operations perform on pointer with example.
(b) Draw flowchart for checking weather given number is prime or not.
(c) Write a program to reverse the number 1234 (i.e. 4321) using function.
(d) Differentiate between character array and integer array with respect to size
and initialisation.
22226 [2 of 2]
3. Attempt any THREE of the following : 12
(a) Write a program to sum all the odd numbers between 1 to 20.
(b) Explain any four bit-wise operator used in ‘C’ with example.
(c) With suitable example, explain how two dimensional arrays can be created.
(d) Explain any two string functions with example.
4. Attempt any THREE of the following : 12
(a) Draw flowchart for finding largest number among three numbers.
(b) Describe generic structure of ‘C’ program.
(c) Write a program to take input as a number and reverse it by while loop.
(d) Write a program to accept 10 numbers in array and arrange them in ascending
order.
(e) Explain meaning of following statement with reference to pointers :
int *a, b;
b = 20;
*a = b;
A = &b;
5. Attempt any TWO of the following : 12
(a) Write a program to perform addition, subtraction, multiplication and division
of two integer number using function.
(b) Define Array. Write a program to accept ten numbers in array. Sort array
element and display.
(c) Write a program to print reverse of a entered string using pointer.
6. Attempt any TWO of the following : 12
(a) Explain recursion with suitable example. List any two advantages.
(b) Write a program to accept ten numbers and print average of it.
(c) Enlist different format specifiers with its use.
_______________
MA
H
ARA
SH
T
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
I
m
p
orta
n
t
Ins
tr
u
ct
i
o
ns
to exam
in
er
s
:
1) The an
s
wer
s
s
hou
l
d be exa
mi
ned by key word
s
and no
t
a
s
word-
t
o-word a
s
g
i
ven
i
n
t
he
m
ode
l
an
s
wer
s
che
m
e.
2) The
m
ode
l
an
s
wer and
t
he an
s
wer wr
itt
en by cand
i
da
t
e
m
ay vary bu
t
t
he exa
mi
ner
m
ay
t
ry
t
o
a
ss
e
ss
t
he under
st
and
i
ng
l
eve
l
of
t
he cand
i
da
t
e.
3) The
l
anguage error
s
s
uch a
s
gra
mm
a
ti
ca
l
,
s
pe
lli
ng error
s
s
hou
l
d no
t
be g
i
ven
m
ore I
m
por
t
ance
(No
t
app
li
cab
l
e for
s
ub
j
ec
t
Eng
lis
h and
C
o
mm
un
i
ca
ti
on
S
k
ills
).
4) Wh
il
e a
ss
e
ssi
ng f
i
gure
s
, exa
mi
ner
m
ay g
i
ve cred
it
for pr
i
nc
i
pa
l
co
m
ponen
ts
i
nd
i
ca
t
ed
i
n
t
he
f
i
gure. The f
i
gure
s
drawn by cand
i
da
t
e and
m
ode
l
an
s
wer
m
ay vary. The exa
mi
ner
m
ay g
i
ve
cred
it
for any equ
i
va
l
en
t
f
i
gure drawn.
5)
C
red
its
m
ay be g
i
ven
st
ep w
is
e for nu
m
er
i
ca
l
prob
l
e
ms
. In
s
o
m
e ca
s
e
s
,
t
he a
ss
u
m
ed con
st
an
t
an
s
wer.
6) In ca
s
e of
s
o
m
e que
sti
on
s
cred
it
m
ay be g
i
ven by
j
udge
m
en
t
on par
t
of exa
mi
ner of re
l
evan
t
d
i
ng.
7)
F
or progra
mmi
ng
l
anguage paper
s
, cred
it
m
ay be g
i
ven
t
o any o
t
her progra
m
ba
s
ed on
equ
i
va
l
en
t
concep
t
.
Q.
No
.
S
ub
Q.N.
An
s
wer
M
ark
i
ng
S
che
m
e
1.
(a)
A
ns
.
Attem
p
t a
n
y F
I
V
E
of t
h
e fo
ll
ow
in
g:
Draw f
l
owc
h
art for c
h
ec
kin
g w
h
et
h
er g
i
ve
n
nu
m
b
er
is
eve
n
or
o
dd
.
10
2M
C
o
rr
ec
t
l
og
i
c 1
M
R
e
l
eva
nt
s
y
m
bo
l
1
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
(
b
)
A
ns
.
( ).
Keyword U
s
e
au
t
o I
t
is
u
s
ed
t
o dec
l
are au
t
o
st
orage c
l
a
ss
var
i
ab
l
e.
break I
t
is
u
s
ed
t
o ex
it
fro
m
b
l
ock or
l
oop.
ca
s
e I
t
is
u
s
ed
t
o repre
s
en
t
po
ssi
b
l
e ca
s
e
i
n
si
de
s
w
it
ch
ca
s
e
st
a
t
e
m
en
t
char U
s
ed for dec
l
ara
ti
on of charac
t
er
t
ype var
i
ab
l
e
con
st
I
t
is
u
s
ed
t
o dec
l
are a con
st
an
t
.
con
ti
nue I
t
is
u
s
ed pa
ss
con
t
ro
l
a
t
t
he beg
i
nn
i
ng of
t
he
l
oop
defau
lt
I
t
is
u
s
ed
t
o repre
s
en
t
defau
lt
ca
s
e
i
n
si
de
s
w
it
ch
ca
s
e
st
a
t
e
m
en
t
.
do I
t
is
u
s
ed
t
o execu
t
e
l
oop
i
n a
ss
oc
i
a
ti
on w
it
h
wh
il
e cond
iti
on.
doub
l
e U
s
ed for dec
l
ara
ti
on of doub
l
e
t
ype var
i
ab
l
e
e
ls
e I
t
is
u
s
ed w
it
h
i
f
st
a
t
e
m
en
t
t
o
t
ran
s
fer con
t
ro
l
t
o
st
a
t
e
m
en
t
when cond
iti
on
is
fa
ls
e.
enu
m
I
t
is
u
s
ed
t
o dec
l
are enu
m
era
t
ed da
t
a.
ex
t
ern I
t
is
u
s
ed
t
o dec
l
are ex
t
ern
st
orage c
l
a
ss
var
i
ab
l
e
f
l
oa
t
U
s
ed for dec
l
ara
ti
on of f
l
oa
t
t
ype var
i
ab
l
e
for U
s
ed for repe
titi
ve execu
ti
on of
st
a
t
e
m
en
ts
go
t
o I
t
is
u
s
ed
t
o
t
ran
s
fer con
t
ro
l
fro
m
one
st
a
t
e
m
en
t
t
o ano
t
her
i
f I
t
is
u
s
ed for cond
iti
on check
i
ng
i
n
t
U
s
ed for dec
l
ara
ti
on of
i
n
t
eger
t
ype var
i
ab
l
e
l
ong U
s
ed for dec
l
ara
ti
on of
l
ong
t
ype var
i
ab
l
e
reg
ist
er I
t
is
u
s
ed
t
o dec
l
are reg
ist
er
st
orage c
l
a
ss
var
i
ab
l
e
re
t
urn I
t
is
u
s
ed
t
o re
t
urn va
l
ue fro
m
func
ti
on.
s
hor
t
U
s
ed for dec
l
ara
ti
on of
s
hor
t
t
ype var
i
ab
l
e
si
gned U
s
ed for dec
l
ara
ti
on of
si
gned
t
ype var
i
ab
l
e
si
zeof I
t
re
t
urn
s
m
e
m
ory
si
ze a
ll
oca
t
ed
t
o var
i
ab
l
e or
da
t
a
t
ype
st
a
ti
c I
t
is
u
s
ed
t
o dec
l
are
st
a
ti
c
st
orage c
l
a
ss
var
i
ab
l
e
st
ruc
t
I
t
is
u
s
ed
t
o dec
l
are u
s
er def
i
ned da
t
a
t
ype
st
ruc
t
ure
2M
An
y
fo
ur
key
w
o
r
d
s
1
M
U
s
e 1
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
s
w
it
ch I
t
is
u
s
ed
t
o
m
ake dec
isi
on fro
m
m
u
lti
p
l
e nu
m
ber
of
i
npu
ts
t
ypedef U
s
ed
t
o redef
i
ne
t
he na
m
e of an ex
isti
ng var
i
ab
l
e
t
ype.
un
i
on I
t
is
u
s
ed
t
o dec
l
are
t
he da
t
a
t
ype un
i
on
un
si
gned U
s
ed for dec
l
ara
ti
on of un
si
gned
t
ype var
i
ab
l
e
vo
i
d
S
pec
i
fy
t
ha
t
func
ti
on doe
s
no
t
re
t
urn any va
l
ue
vo
l
a
til
e I
t
is
u
s
ed
t
o dec
l
are a vo
l
a
til
e var
i
ab
l
e
wh
il
e U
s
ed for repe
titi
ve execu
ti
on of
st
a
t
e
m
en
ts
(c)
A
ns
.
Wr
i
te t
h
e
s
y
n
tax of
s
w
i
tc
h
ca
s
e
s
tateme
n
t.
s
w
it
ch(var
i
ab
l
e)
{
ca
s
e va
l
ue1
:
st
a
t
e
m
en
ts
break
;
ca
s
e va
l
ue2
:
st
a
t
e
m
en
ts;
break
;
.
.
.
defau
lt:
st
a
t
e
m
en
ts;
break
;
}
2M
C
o
rr
ec
t
s
y
nt
ax
2
M
(
d
)
A
ns
.
S
tate a
n
y two
di
ffere
n
ce
s
b
etwee
n
w
hil
e a
nd
d
o-w
hil
e
s
tateme
n
t.
(No
t
e:
An
y 2 po
ints
sh
a
ll
be co
nsi
de
r
ed).
w
hil
e Do-w
hil
e
In 'wh
il
e'
l
oop
t
he con
t
ro
lli
ng
cond
iti
on appear
s
a
t
t
he
st
ar
t
of
t
he
l
oop.
In 'do-wh
il
e'
l
oop
t
he
con
t
ro
lli
ng cond
iti
on appear
s
a
t
t
he end of
t
he
l
oop.
The
it
era
ti
on
s
do no
t
occur
i
f,
t
he cond
iti
on a
t
t
he f
i
r
st
it
era
ti
on, appear
s
fa
ls
e.
The
it
era
ti
on occur
s
a
t
l
ea
st
once even
i
f
t
he cond
iti
on
is
fa
ls
e a
t
t
he f
i
r
st
it
era
ti
on.
I
t
is
an en
t
ry con
t
ro
ll
ed
l
oop I
t
is
an ex
it
con
t
ro
ll
ed
l
oop
wh
il
e(cond
iti
on) {
body
do {
body
2M
An
y
tw
o
d
i
ffe
r
e
n
ce
s
1
M
eac
h
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
} }wh
il
e(cond
iti
on)
;
(e)
A
ns
.
S
tate
di
ffere
n
ce
b
etwee
n
array a
nd
s
tr
in
g.
(No
t
e:
An
y
tw
o va
li
d po
ints
sh
a
ll
be co
nsi
de
r
ed).
Array
S
tr
in
g
Array can be of any
t
ype
li
ke
i
n
t
, f
l
oa
t
, char.
St
r
i
ng can con
t
a
i
n on
l
y
charac
t
er
s
.
E
l
e
m
en
t
E
l
e
m
en
ts
i
n an array
can be acce
ss
ed u
si
ng
its
po
siti
on
li
ke a[2].
s
i
n an array
can be acce
ss
ed u
si
ng
its
po
siti
on
li
ke a[2].
C
harac
t
er
s
i
n
st
r
i
ng are acce
ss
ed
s
equen
ti
a
ll
y fro
m
f
i
r
st
t
o
l
a
st
.
Array doe
s
no
t
end w
it
h a nu
ll
charac
t
er
S \
charac
t
er.
Array
si
ze once dec
l
ared canno
t
be changed
St
r
i
ng
si
ze can be
m
od
i
f
i
ed
u
si
ng po
i
n
t
er.
2M
An
y
tw
o
po
ints
1
M
fo
r
eac
h
(f)
A
ns
.
Dec
l
are a
s
tr
u
ct
u
re
s
t
ud
e
n
t w
i
t
h
e
l
eme
n
t ro
ll
-
n
o a
nd
n
ame.
st
ruc
t
st
uden
t
{
i
n
t
ro
ll
_no
;
char na
m
e[20]
;
}
;
2M
C
o
rr
ec
t
dec
l
a
r
a
ti
o
n
2
M
(g)
A
ns
.
D
is
t
in
g
uish
b
etwee
n
ca
ll
b
y va
lu
e a
nd
ca
ll
b
y refere
n
ce.
(No
t
e:
An
y
tw
o po
ints
sh
a
ll
be co
nsi
de
r
ed).
Ca
ll
b
y va
lu
e Ca
ll
b
y refere
n
ce
A copy of ac
t
ua
l
argu
m
en
ts
is
pa
ss
ed
t
o re
s
pec
ti
ve for
m
a
l
argu
m
en
ts
.
The addre
ss
of ac
t
ua
l
argu
m
en
ts
is
pa
ss
ed
t
o for
m
a
l
argu
m
en
ts
Ac
t
ua
l
argu
m
en
ts
w
ill
re
m
a
i
n
s
afe,
t
hey canno
t
be
m
od
i
f
i
ed
acc
i
den
t
a
ll
y.
A
lt
era
ti
on
t
o ac
t
ua
l
argu
m
en
ts
is
po
ssi
b
l
e w
it
h
i
n fro
m
ca
ll
ed
func
ti
on
;
t
herefore
t
he code
m
u
st
hand
l
e argu
m
en
ts
carefu
ll
y e
ls
e
you ge
t
unexpec
t
ed re
s
u
lts
.
Addre
ss
of
t
he ac
t
ua
l
and for
m
a
l
argu
m
en
ts
are d
i
fferen
t
Addre
ss
of
t
he ac
t
ua
l
and for
m
a
l
argu
m
en
ts
are
t
he
s
a
m
e
C
hange
s
m
ade
i
n
si
de
t
he func
ti
on
is
no
t
ref
l
ec
t
ed
i
n o
t
her func
ti
on
s
C
hange
s
m
ade
i
n
t
he func
ti
on
is
ref
l
ec
t
ed ou
tsi
de a
ls
o.
2M
An
y
tw
o
po
ints
1
M
eac
h
2.
(a)
Attem
p
t a
n
y
TH
R
EE
of t
h
e fo
ll
ow
in
g:
S
tate fo
u
r ar
i
t
h
met
i
c o
p
erat
i
o
ns
p
erform o
n
p
o
in
ter w
i
t
h
12
4M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
A
ns
.
exam
pl
e.
(No
t
e:
C
ode
sni
ppe
t
sh
a
ll
be co
nsi
de
r
ed)
The po
i
n
t
er ar
it
h
m
e
ti
c
is
done a
s
per
t
he da
t
a
t
ype of
t
he po
i
n
t
er. The
ba
si
c opera
ti
on
s
on po
i
n
t
er
s
are
In
creme
n
t:
I
t
is
u
s
ed
t
o
i
ncre
m
en
t
t
he po
i
n
t
er. Each
tim
e a po
i
n
t
er
is
i
ncre
m
en
t
ed,
it
po
i
n
ts
t
o
t
he nex
t
l
oca
ti
on w
it
h re
s
pec
t
t
o
m
e
m
ory
si
ze .
Exa
m
p
l
e,
If p
t
r
is
an
i
n
t
eger po
i
n
t
er
st
ored a
t
addre
ss
1000,
t
hen p
t
r
++
s
how
s
1002 a
s
i
ncre
m
en
t
ed
l
oca
ti
on for an
i
n
t
.I
t
i
ncre
m
en
ts
by
t
wo
l
oca
ti
on
s
a
s
it
requ
i
re
s
t
wo by
t
e
s
st
orage.
Decreme
n
t:
I
t
is
u
s
ed
t
o decre
m
en
t
t
he po
i
n
t
er. Each
tim
e a po
i
n
t
er
is
decre
m
en
t
ed,
it
po
i
n
ts
t
o
t
he prev
i
ou
s
l
oca
ti
on w
it
h re
s
pec
t
t
o
m
e
m
ory
si
ze.
Exa
m
p
l
e,
If
t
he curren
t
po
siti
on of po
i
n
t
er
is
1002,
t
hen decre
m
en
t
opera
ti
on
p
t
r-- re
s
u
lts
i
n
t
he po
i
n
t
er po
i
n
ti
ng
t
o
t
he
l
oca
ti
on 1000
i
n ca
s
e of
i
n
t
eger po
i
n
t
er a
s
it
requ
i
re
t
wo by
t
e
s
st
orage.
A
ddi
t
i
o
n
When add
iti
on opera
ti
on
is
perfor
m
ed on po
i
n
t
er,
it
g
i
ve
s
t
he
l
oca
ti
on
i
ncre
m
en
t
ed by
t
he added va
l
ue accord
i
ng
t
o da
t
a
t
ype.
Eg
:
If p
t
r
is
an
i
n
t
eger po
i
n
t
er
st
ored a
t
addre
ss
1000,
Then p
t
r
+
2
s
how
s
1000
+
(2*2)
=
1004 a
s
i
ncre
m
en
t
ed
l
oca
ti
on for an
i
n
t
.
Sub
tract
i
o
n
When
s
ub
t
rac
ti
on opera
ti
on
is
perfor
m
ed on
t
he po
i
n
t
er var
i
ab
l
e,
it
g
i
ve
s
t
he
l
oca
ti
on decre
m
en
t
ed by
t
he
s
ub
t
rac
t
ed va
l
ue accord
i
ng
t
o
da
t
a
t
ype.
Eg
:
If p
t
r
is
an
i
n
t
eger po
i
n
t
er
st
ored a
t
addre
ss
1004,
Then p
t
r-2
s
how
s
1004-(2*2)
=
1000 a
s
decre
m
en
t
ed
l
oca
ti
on for an
i
n
t
.
E
ac
h
ope
r
a
ti
o
n
with
exa
m
p
l
e
1
M
(
b
) Draw f
l
owc
h
art for c
h
ec
kin
g weat
h
er g
i
ve
n
nu
m
b
er
is
p
r
i
me or 4M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
A
ns
.
n
ot.
C
o
rr
ec
t
l
og
i
c 2
M
S
y
m
bo
ls
2
M
(c)
A
ns
.
Wr
i
te a
p
rogram to rever
s
e t
h
e
nu
m
b
er 1234 (
i
.e. 4321)
usin
g
f
un
ct
i
o
n
.
(No
t
e:
An
y o
th
e
r
co
rr
ec
t
l
og
i
c
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d f
i
nd
R
ever
s
e()
;
vo
i
d
m
a
i
n()
{
f
i
nd
R
ever
s
e()
;
}
vo
i
d f
i
nd
R
ever
s
e()
{
4M
C
o
rr
ec
t
s
y
nt
ax
2
M
C
o
rr
ec
t
l
og
i
c 2
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
i
n
t
nu
m
, re
s=
0,an
s=
0
;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er
t
he nu
m
ber")
;
s
canf("%d",
&
nu
m
)
;
wh
il
e(nu
m
!
=
0)
{
re
s=
nu
m
%10
;
an
s=
an
s
*10
+
re
s;
nu
m=
nu
m/
10
;
}
pr
i
n
t
f("
R
ever
s
e nu
m
ber
is
%d", an
s
)
;
ge
t
ch()
;
}
(
d
)
A
ns
.
D
i
ffere
n
t
i
ate
b
etwee
n
c
h
aracter array a
nd
in
teger array w
i
t
h
re
sp
ect to
si
ze a
nd
ini
t
i
a
lis
at
i
o
n
.
Parameter C
h
aracter Array
In
teger Array
Si
ze La
st
l
oca
ti
on
i
n
charac
t
er array
is
f
ill
ed w
it
h '
\
0'
s
o
t
he
array
si
ze
s
hou
l
d be
s
o dec
l
ared
t
ha
t
it
s
hou
l
d have one
l
a
st
l
oca
ti
on for '
\
0'
charac
t
er.
No ex
t
ra
l
oca
ti
on
t
han
t
he nu
m
ber of
e
l
e
m
en
ts
is
requ
i
red.
In
iti
a
li
za
ti
on In
iti
a
li
za
ti
on can be
done
li
ke
:
char
st
r[4]
=
{'a','b','c','
\
0'}
;
char
st
r[4]
=
"abc"
;
In
iti
a
li
za
ti
on can be
done
li
ke
:
i
n
t
arr[4]
=
{1,2,3,4}
;
4M
E
ac
h
pa
r
a
m
e
t
e
r
2
M
3.
(a)
A
ns
.
Attem
p
t a
n
y
TH
R
EE
of t
h
e fo
ll
ow
in
g:
Wr
i
te a
p
rogram to
su
m a
ll
t
h
e o
dd
nu
m
b
er
s
b
etwee
n
1 to 20.
(No
t
e:
An
y o
th
e
r
co
rr
ec
t
l
og
i
c
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d
m
a
i
n()
{
i
n
t
s
u
m=
0,
i;
c
l
r
s
cr()
;
for(
i=
1
;i<=
20
;i++
)
12
4M
C
o
rr
ec
t
l
og
i
c
2
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
{
i
f(
i
%2
==
1)
s
u
m=s
u
m+i;
}
ge
t
ch()
;
}
C
o
rr
ec
t
s
y
nt
ax
2
M
(
b
)
A
ns
.
E
x
pl
a
in
a
n
y fo
u
r
bi
t-
Bi
tw
is
e o
p
erator
s
:
Bi
tw
is
e
O
R
|
I
t
t
ake
s
2 b
it
pa
tt
ern
s
and perfor
ms
O
R
opera
ti
on
s
on each pa
i
r of
corre
s
pond
i
ng b
its
. The fo
ll
ow
i
ng exa
m
p
l
e w
ill
exp
l
a
i
n
it
.
1010
1100
--------
O
R
1110
Bi
tw
is
e AND &
I
t
t
ake
s
2 b
it
pa
tt
ern
s
and perfor
ms
AND opera
ti
on
s
w
it
h
it
.
1010
1100
-------
AND 1000
-------
The
Bit
w
is
e AND w
ill
t
ake pa
i
r of b
its
fro
m
each po
siti
on, and
i
f
on
l
y bo
t
h
t
he b
it
is
1,
t
he re
s
u
lt
on
t
ha
t
po
siti
on w
ill
be 1.
Bit
w
is
e
AND
is
u
s
ed
t
o Turn-Off b
its
.
Bi
tw
is
e N
OT
One
s
co
m
p
l
e
m
en
t
opera
t
or (
Bit
w
is
e NOT)
is
u
s
ed
t
o conver
t
each
-b
it
t
o 0- -b
it
t
o1-
unary opera
t
or
i
.e.
it
t
ake
s
on
l
y one operand.
1001
NOT 0110
-------
Bi
tw
is
e X
O
R
^
Bit
w
is
e XO
R
^,
t
ake
s
2 b
it
pa
tt
ern
s
and perfor
m
XO
R
opera
ti
on w
it
h
it
.
4M
E
xp
l
a
n
a
ti
o
n
with
exa
m
p
l
e
of a
n
y
fo
ur
b
itwis
e
ope
r
a
t
o
r
1
M
eac
h
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
0101
0110
------
XO
R
0011
------
L
eft
shi
ft
Op
erator
<<
The
l
ef
t
s
h
i
f
t
opera
t
or w
ill
s
h
i
f
t
t
he b
its
t
oward
s
l
ef
t
for
t
he g
i
ven
nu
m
ber of
tim
e
s
.
i
n
t
a
=
2
<<
1
;
R
i
g
h
t
shi
ft
Op
erator
>>
The r
i
gh
t
s
h
i
f
t
opera
t
or w
ill
s
h
i
f
t
t
he b
its
t
oward
s
r
i
gh
t
for
t
he g
i
ven
nu
m
ber of
tim
e
s
.
i
n
t
a
=
8
>>
1
;
(c)
A
ns
.
W
i
t
h
sui
ta
bl
e exam
pl
e, ex
pl
a
in
h
ow two
di
me
nsi
o
n
a
l
array
s
ca
n
b
e create
d
.
The array wh
i
ch
is
u
s
ed
t
o repre
s
en
t
and
st
ore da
t
a
i
n a
t
abu
l
ar for
m
is
ca
ll
ed a
s
t
wo d
im
en
si
ona
l
array.
S
uch
t
ype of array
is
s
pec
i
a
ll
y
u
s
ed
t
o repre
s
en
t
da
t
a
i
n a
m
a
t
r
i
x for
m
.
Dec
l
ara
ti
on of
t
wo d
im
en
si
ona
l
array
s:
Syn
t
ax:-
Da
t
a
t
ype arrayna
m
e [row
si
ze] [co
l
u
m
n
si
ze]
;
Eg:
i
n
t
arr[3][4]
;
and 4 co
l
u
m
n
s
.
A
t
wo-d
im
en
si
ona
l
array can be con
si
dered a
s
a
t
ab
l
e wh
i
ch w
ill
have
x nu
m
ber of row
s
and y nu
m
ber of co
l
u
m
n
s
. A
t
wo-d
im
en
si
ona
l
array
a, wh
i
ch con
t
a
i
n
s
t
hree row
s
and four co
l
u
m
n
s
can be
s
hown a
s
fo
ll
ow
s
4M
E
xp
l
a
n
a
ti
o
n
2
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
Thu
s
, every e
l
e
m
en
t
i
n
t
he array a
is
i
den
ti
f
i
ed by an e
l
e
m
en
t
na
m
e of
t
he for
m
a[
i
][
j
], where 'a'
is
t
he na
m
e of
t
he array, and '
i
' and '
j
' are
t
he
s
ub
s
cr
i
p
ts
t
ha
t
un
i
que
l
y
i
den
ti
fy each e
l
e
m
en
t
i
n 'a'.
E
xam
pl
e :
m
a
i
n()
{
i
n
t
a[2][2]
=
{{1,2},{4,5})
;
i
n
t
i
,
j;
for(
i=
0
;i<
2
;i++
)
{
for(
j=
0
;j<
2
;j++
)
{
}
\
}
}
E
xa
m
p
l
e
2
M
(
d
)
A
ns
.
E
x
pl
a
in
a
n
y two
s
tr
in
g f
un
ct
i
o
ns
w
i
t
h
exam
pl
e.
S
tr
l
e
n
f
un
ct
i
o
n
:
st
r
l
en( ) func
ti
on
i
n
C
g
i
ve
s
t
he
l
eng
t
h of
t
he g
i
ven
st
r
i
ng.
st
r
l
en( )
func
ti
on coun
ts
t
he nu
m
ber of charac
t
er
s
i
n a g
i
ven
st
r
i
ng and re
t
urn
s
t
he
i
n
t
eger va
l
ue. I
t
st
op
s
coun
ti
ng
t
he charac
t
er when nu
ll
charac
t
er
is
found.
B
ecau
s
e, nu
ll
charac
t
er
i
nd
i
ca
t
e
s
t
he end of
t
he
st
r
i
ng
i
n
C
.
S
y
nt
ax:
s
tr
l
e
n
(
s
tr
in
g
n
ame);
E
xa
m
p
l
e:
st
r
l
en(
st
r1)
;
re
t
urn
s
l
eng
t
h of
st
r1 a
s
3
4M
E
xp
l
a
n
a
ti
o
n
of
a
n
y
tw
o
strin
g
f
un
c
ti
o
n
s
1
M
eac
h
,
exa
m
p
l
e
1
M
eac
h
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
s
trcat() f
un
ct
i
o
n
:
In
C
progra
mmi
ng,
st
rca
t
() conca
t
ena
t
e
s
(
j
o
i
n
s
)
t
wo
st
r
i
ng
s
. I
t
conca
t
ena
t
e
s
s
ource
st
r
i
ng a
t
t
he end of de
sti
na
ti
on
st
r
i
ng.
S
y
nt
ax:
s
trcat(
d
e
s
t
in
at
i
o
ns
o
u
rce,
s
o
u
rce
s
tr
in
g);
E
xa
m
p
l
e:
st
rca
t
(
st
r1,
st
r2)
;
re
t
urn
s
abcdef
i
n
st
r1 and
st
r2 re
m
a
i
n
s
unchanged.
s
trc
p
y() f
un
ct
i
o
n
st
rncpy( ) func
ti
on cop
i
e
s
por
ti
on of con
t
en
ts
of one
st
r
i
ng
i
n
t
o
ano
t
her
st
r
i
ng.
S
y
nt
ax:
st
rncpy( de
sti
na
ti
on
st
r
i
ng,
s
ource
st
r
i
ng,
si
ze )
;
E
xa
m
p
l
e:
st
rcpy(
st
r1,
st
r2)
;
re
t
urn
s
abc
st
r2
s
trcm
p
() f
un
ct
i
o
n
The
st
rc
m
p func
ti
on co
m
pare
s
t
wo
st
r
i
ng
s
wh
i
ch are pa
ss
ed a
s
argu
m
en
ts
t
o
it
. If
t
he
st
r
i
ng
s
are equa
l
t
hen func
ti
on re
t
urn
s
va
l
ue 0 and
i
f
t
hey are no
t
equa
l
t
he func
ti
on
re
t
urn
s
s
o
m
e nu
m
er
i
c va
l
ue.
S
y
nt
ax:
st
rc
m
p(
st
r1,
st
r2)
;
E
xa
m
p
l
e:
Then
st
rc
m
p(
st
r1,
st
r2) re
t
urn
s
0 a
s
bo
t
h
t
he
st
r
i
ng
s
are
s
a
m
e.
4.
(a)
A
ns
.
Attem
p
t a
n
y
TH
R
EE
of t
h
e fo
ll
ow
in
g:
Draw f
l
owc
h
art for f
indin
g
l
arge
s
t
nu
m
b
er amo
n
g t
h
ree
nu
m
b
er
s
.
12
4M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
C
o
rr
ec
t
f
l
o
w
c
h
a
r
t
4
M
(
b
)
A
ns
.
4M
L
ist
of
s
ec
ti
o
ns
f
r
o
m
stru
c
tur
e 1
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
Doc
u
me
n
tat
i
o
n
s
ect
i
o
n
:
The docu
m
en
t
a
ti
on
s
ec
ti
on con
sists
of a
s
e
t
of co
mm
en
t
li
ne
s
g
i
v
i
ng
t
he na
m
e of
t
he progra
m
,
t
he au
t
hor and
o
t
her de
t
a
ils
, wh
i
ch
t
he progra
mm
er wou
l
d
li
ke
t
o u
s
e
l
a
t
er.
Link
s
ect
i
o
n
:
The
li
nk
s
ec
ti
on prov
i
de
s
i
n
st
ruc
ti
on
s
t
o
t
he co
m
p
il
er
t
o
li
nk func
ti
on
s
fro
m
t
he
s
y
st
e
m
li
brary
s
uch a
s
u
si
ng
t
he #
i
nc
l
ude
d
i
rec
ti
ve.
Def
ini
t
i
o
n
s
ect
i
o
n
:
The def
i
n
iti
on
s
ec
ti
on def
i
ne
s
a
ll
s
y
m
bo
li
c
con
st
an
ts
s
uch u
si
ng
t
he #def
i
ne d
i
rec
ti
ve.
Gl
o
b
a
l
d
ec
l
arat
i
o
n
s
ect
i
o
n
:
There are
s
o
m
e var
i
ab
l
e
s
t
ha
t
are u
s
ed
i
n
m
ore
t
han one func
ti
on.
S
uch var
i
ab
l
e
s
are ca
ll
ed g
l
oba
l
var
i
ab
l
e
s
and
are dec
l
ared
i
n
t
he g
l
oba
l
dec
l
ara
ti
on
s
ec
ti
on
t
ha
t
is
ou
tsi
de of a
ll
t
he
func
ti
on
s
.
Dec
l
arat
i
o
n
p
art
:
The dec
l
ara
ti
on par
t
dec
l
are
s
a
ll
t
he var
i
ab
l
e
s
u
s
ed
i
n
t
he execu
t
ab
l
e par
t
.
Subp
rogram
s
ect
i
o
n
:
If
t
he progra
m
is
a
m
u
lti
-func
ti
on progra
m
t
hen
t
he
s
ubprogra
m
s
ec
ti
on con
t
a
i
n
s
a
ll
t
he u
s
er-def
i
ned func
ti
on
s
t
ha
t
are ca
ll
ed
i
n
t
he
m
a
i
n () func
ti
on. U
s
er-def
i
ned func
ti
on
s
are
genera
ll
y p
l
aced
imm
ed
i
a
t
e
l
y af
t
er
t
he
m
a
i
n () func
ti
on, a
lt
hough
t
hey
m
ay appear
i
n any order.
H
ea
d
er f
il
e
s
A header f
il
e
is
a f
il
e w
it
h ex
t
en
si
on .h wh
i
ch con
t
a
i
n
s
C
func
ti
on
dec
l
ara
ti
on
s
and
m
acro def
i
n
iti
on
s
t
o be
s
hared be
t
ween
s
evera
l
s
ource f
il
e
s
.
In
c
lud
e
S
y
n
tax
B
o
t
h
t
he u
s
er and
t
he
s
y
st
e
m
header f
il
e
s
are
i
nc
l
uded u
si
ng
t
he
preproce
ssi
ng d
i
rec
ti
ve #
i
nc
l
ude.
ma
in
() func
ti
on
is
t
he en
t
ry po
i
n
t
of any
C
progra
m
. I
t
is
t
he po
i
n
t
a
t
wh
i
ch execu
ti
on of progra
m
is
st
ar
t
ed. Every
C
progra
m
have a
m
a
i
n() func
ti
on.
C
o
rr
ec
t
de
s
c
ri
p
ti
o
n
of
stru
c
tur
e 3
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
(c)
A
ns
.
Wr
i
te a
p
rogram to ta
k
e
inpu
t a
s
a
nu
m
b
er a
nd
rever
s
e
i
t
b
y
w
hil
e
l
oo
p
.
(No
t
e:
An
y o
th
e
r
co
rr
ec
t
l
og
i
c
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d
m
a
i
n()
{
i
n
t
no
;
i
n
t
s
u
m=
0,re
m;
pr
i
n
t
f("
\
n En
t
er nu
m
ber
:
")
;
s
canf("%d",
&
no)
;
wh
il
e(no
>
0)
{
re
m=
no%10
;
no
=
no
/
10
;
s
u
m=s
u
m
*10
+
r e
m;
}
pr
i
n
t
f("
\
n
s
u
m=
%d",
s
u
m
)
;
ge
t
ch()
;
}
4M
A
ccep
t
in
p
ut
1
M
U
s
e of
whil
e
l
oop 1
M
co
rr
ec
t
s
y
nt
ax
2
M
(
d
)
A
ns
.
Wr
i
te a
p
rogram to acce
p
t 10
nu
m
b
er
s
in
array a
nd
arra
n
ge
t
h
em
in
a
s
ce
ndin
g or
d
er.
(No
t
e:
An
y o
th
e
r
co
rr
ec
t
l
og
i
c
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d
m
a
i
n()
{
i
n
t
arr[10],
i
,
j
,
t
e
m
p
;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er array e
l
e
m
en
ts:
")
;
for(
i=
0
;i<
10
;i++
)
{
s
canf("%d",
&
arr[
i
])
;
}
pr
i
n
t
f("
\
n
\
n Array e
l
e
m
en
ts
are
:
")
;
for(
i=
0
;i<
10
;i++
)
{
pr
i
n
t
f("%d ",arr[
i
])
;
4M
C
o
rr
ec
t
l
og
i
c
2
M
C
o
rr
ec
t
s
y
nt
ax
2
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
}
for(
j=
0
;j<
10
;j++
)
{
for(
i=
0
;i<
10
;i++
)
{
i
f(arr[
i+
1]
<
arr[
i
])
{
t
e
m
p
=
arr[
i
]
;
arr[
i
]
=
arr[
i+
1]
;
arr[
i+
1]
=t
e
m
p
;
}
}
}
pr
i
n
t
f("
\
n
\
nArray e
l
e
m
en
ts
i
n a
s
cend
i
ng order are
:
")
;
for(
i=
0
;i<
10
;i++
)
{
pr
i
n
t
f("%d ",arr[
i
])
;
}
ge
t
ch()
;
}
(e)
A
ns
.
E
x
pl
a
in
mea
nin
g of fo
ll
ow
in
g
s
tateme
n
t w
i
t
h
refere
n
ce to
p
o
in
ter
s
:
in
t *a,
b
;
b=
20;
* a
=b
;
A
=
&
b
;
in
t *a,
b
;
I
t
is
dec
l
ara
ti
on of
i
n
t
eger po
i
n
t
er a and
i
n
t
eger var
i
ab
l
e b
b=
20;
va
l
ue 20
is
a
ssi
gned
t
o var
i
ab
l
e b.
*a
=b
;
Va
l
ue of b
is
a
ssi
gned
t
o po
i
n
t
er a.
A
=
&
b
;
Addre
ss
of b
is
a
ssi
gned
t
o var
i
ab
l
e A.
4M
C
o
rr
ec
t
m
ea
nin
g
of eac
h
st
a
t
e
m
e
n
t
1
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
5.
(a)
A
ns
.
Attem
p
t a
n
y
T
W
O
of t
h
e fo
ll
ow
in
g:
Wr
i
te a
p
rogram to
p
erform a
ddi
t
i
o
n
,
sub
tract
i
o
n
, m
ul
t
ipli
cat
i
o
n
a
nd
di
v
isi
o
n
of two
in
teger
nu
m
b
er
usin
g f
un
ct
i
o
n
.
(No
t
e:
An
y o
th
e
r
co
rr
ec
t
l
og
i
c
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d add(
i
n
t
x,
i
n
t
y)
{
pr
i
n
t
f("
\
nAdd
iti
on
=
%d",x
+
y)
;
}
vo
i
d
s
ub(
i
n
t
x,
i
n
t
y)
{
pr
i
n
t
f("
\
n
S
ub
t
rac
ti
on
=
%d",x-y)
;
}
vo
i
d
m
u
lt
(
i
n
t
x,
i
n
t
y)
{
pr
i
n
t
f("
\
n
M
u
lti
p
li
ca
ti
on
=
%d",x*y)
;
}
vo
i
d d
i
v(
i
n
t
x,
i
n
t
y)
{
pr
i
n
t
f("
\
nD
i
v
isi
on
=
%d",x
/
y)
;
}
vo
i
d
m
a
i
n()
{
i
n
t
x,y
;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er x
:
")
;
s
canf("%d",
&
x)
;
pr
i
n
t
f("En
t
er y
:
")
;
s
canf("%d",
&
y)
;
add(x,y)
;
s
ub(x,y)
;
m
u
lt
(x,y)
;
d
i
v(x,y)
;
ge
t
ch()
;
}
12
6M
A
dd
f
un
c
ti
o
n
1
M
su
b
f
un
c
ti
o
n
1
M
Mult
f
un
c
ti
o
n
1
M
D
i
v
f
un
c
ti
o
n
1
M
M
a
in
f
un
c
ti
o
n
2
M
(
b
)
Def
in
e Array. Wr
i
te a
p
rogram to acce
p
t te
n
nu
m
b
er
s
in
array.
S
ort array e
l
eme
n
t a
nd
displ
ay.
6M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
A
ns
.
Def
ini
t
i
o
n
of Array:
An array
is
a co
ll
ec
ti
on of da
t
a e
l
e
m
en
ts
, a
ll
of
t
he
s
a
m
e
t
ype,
acce
ss
ed u
si
ng a co
mm
on na
m
e.
Program:
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d
m
a
i
n()
{
i
n
t
a[10],
i
,
j
,
t
e
m
p
;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er nu
m
ber
s:
")
;
for(
i=
0
;i<
10
;i++
)
s
canf("%d",
&
a[
i
])
;
for(
i=
0
;i<
10
;i++
)
{
for(
j=i+
1
;j<
10
;j++
)
{
i
f(a[
i
]
>
a[
j
])
{
t
e
m
p
=
a[
i
]
;
a[
i
]
=
a[
j
]
;
a[
j
]
=t
e
m
p
;
}
}
}
pr
i
n
t
f("
\
n
S
or
t
ed array e
l
e
m
en
ts:
")
;
for(
i=
0
;i<
10
;i++
)
pr
i
n
t
f("
\
n %d",a[
i
])
;
ge
t
ch()
;
}
Arr
ay
def
initi
o
n
1
M
A
ccep
tin
g a
rr
ay
1
M
S
o
rtin
g
l
og
i
c 3
M
D
is
p
l
ay
s
o
rt
ed
a
rr
ay
1
M
(c)
A
ns
.
Wr
i
te a
p
rogram to
p
r
in
t rever
s
e of a e
n
tere
d
s
tr
in
g
usin
g
p
o
in
ter.
(No
t
e:
An
y o
th
e
r
co
rr
ec
t
l
og
i
c
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d
m
a
i
n()
{
4M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
char
st
r[10],*p
t
r
;
i
n
t
l=
0
;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er
st
r
i
ng
:
")
;
s
canf("%
s
",
st
r)
;
p
t
r
=st
r
;
wh
il
e(*p
t
r!
=
'
\
0')
{
l=l+
1
;
p
t
r
=
p
t
r
+
1
;
}
wh
il
e(
l>
0)
{
p
t
r
=
p
t
r-1
;
pr
i
n
t
f("%c",*p
t
r)
;
l=l
-1
;
}
ge
t
ch()
;
}
A
ccep
tin
g
strin
g
1
M
po
int
e
r
initi
a
liz
a
ti
o
n
1
M
l
og
i
c of
r
eve
rs
e
usin
g
po
int
e
r
3
M
D
is
p
l
ay
i
n
g
r
eve
rs
e
strin
g
1
M
6.
(a)
A
ns
.
Attem
p
t a
n
y
T
W
O
of t
h
e fo
ll
ow
in
g:
E
x
pl
a
in
rec
u
r
si
o
n
w
i
t
h
sui
ta
bl
e exam
pl
e.
Lis
t a
n
y two
a
d
va
n
tage
s
.
R
ecur
si
on
m
ean
s
a func
ti
on ca
lls
its
e
l
f repe
titi
ve
l
y. A recur
si
ve
func
ti
on con
t
a
i
n
s
a func
ti
on ca
ll
t
o
its
e
l
f
i
n
si
de
its
body.
E
xa
m
p
l
e:
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
i
n
t
fac
t
or
i
a
l
(
i
n
t
N)
;
vo
i
d
m
a
i
n()
{
i
n
t
N,fac
t;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er nu
m
ber
:
")
;
s
canf("%d",
&
N)
;
fac
t=
fac
t
or
i
a
l
(N)
;
12
6M
E
xp
l
a
n
a
ti
o
n
of
r
ec
ursi
o
n
1
M
E
xa
m
p
l
e
3
M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
pr
i
n
t
f("
\
n
F
ac
t
or
i
a
l
is:
%d",fac
t
)
;
ge
t
ch()
;
}
i
n
t
fac
t
or
i
a
l
(
i
n
t
N)
{
i
f(N
==
1)
re
t
urn(1)
;
e
ls
e
re
t
urn(N*fac
t
or
i
a
l
(N-1))
;
}
A
d
va
n
tage
s
:
R
educe
s
l
eng
t
h of
t
he progra
m
R
educe
s
unnece
ss
ary ca
lli
ng of a func
ti
on.
U
s
efu
l
when
s
a
m
e
s
o
l
u
ti
on
is
t
o be app
li
ed
m
any
tim
e
s
.
An
y
tw
o
A
dva
nt
a
ge
s
2
M
(
b
)
A
ns
.
Wr
i
te a
p
rogram to acce
p
t te
n
nu
m
b
er
s
a
nd
p
r
in
t average of
i
t.
(No
t
e: P
r
og
r
a
m
with
o
ut
a
rr
ay
sh
a
ll
be co
nsi
de
r
ed).
#
i
nc
l
ude
<st
d
i
o.h
>
#
i
nc
l
ude
<
con
i
o.h
>
vo
i
d
m
a
i
n()
{
i
n
t
a[10],
i
,
s
u
m=
0
;
f
l
oa
t
avg
;
c
l
r
s
cr()
;
pr
i
n
t
f("En
t
er nu
m
ber
s:
")
;
for(
i=
0
;i<
10
;i++
)
s
canf("%d",
&
a[
i
])
;
for(
i=
0
;i<
10
;i++
)
s
u
m=s
u
m+
a[
i
]
;
avg
=s
u
m/
10
;
pr
i
n
t
f("
\
n Average
=
%f", avg)
;
ge
t
ch()
;
}
6M
A
ccep
tin
g 10
num
be
rs
2
M
C
a
l
c
ul
a
t
in
g
ave
r
age
2
M
D
is
p
l
ay
i
n
g
ave
r
age
2
M
(c)
A
ns
.
Enlis
t
di
ffere
n
t format
sp
ec
i
f
i
er
s
w
i
t
h
i
t
s
us
e.
F
or
m
a
t
s
pec
i
f
i
er
t
e
lls
t
he co
m
p
il
er wha
t
t
ype of da
t
a a var
i
ab
l
e ho
l
d
s
dur
i
ng
t
ak
i
ng
i
npu
t
and pr
i
n
ti
ng ou
t
pu
t
u
si
ng
s
canf() and pr
i
n
t
f()
func
ti
on
s
re
s
pec
ti
ve
l
y.
F
or
m
a
t
s
pec
i
f
i
er
s
u
s
ed
i
n
C
progra
mmi
ng
:
6M
MA
H
ARA
SHT
RA
ST
A
TE
BO
ARD
O
F
TE
C
H
N
I
CA
L
E
DUCA
TIO
N
(A
u
to
n
omo
us
)
(
ISO/IE
C - 27001 - 2005 Cert
i
f
i
e
d
)
S
UMM
E
R 2019
E
XAM
I
NA
TIO
N
M
O
D
EL
AN
S
W
E
R
Sub
ject: Programm
in
g
in
C
Sub
ject Co
d
e:
22226
F
or
m
a
t
s
pec
i
f
i
er
U
s
e
%d
S
pec
i
fy da
t
a
t
ype a
s
s
hor
t
si
gned
%u
S
pec
i
fy da
t
a
t
ype a
s
s
hor
t
un
si
gned
%
l
d
S
pec
i
fy da
t
a
t
ype a
s
l
ong
si
nged
%
l
u
S
pec
i
fy da
t
a
t
ype a
s
l
ong un
si
gned
%x
S
pec
i
fy da
t
a
t
ype a
s
un
si
gned hexadec
im
a
l
%o
S
pec
i
fy da
t
a
t
ype a
s
un
si
gned oc
t
a
l
%f
S
pec
i
fy da
t
a
t
ype a
s
f
l
oa
t
%
l
f
S
pec
i
fy da
t
a
t
ype a
s
doub
l
e
%Lf
S
pec
i
fy da
t
a
t
ype a
s
l
ong doub
l
e
%c
S
pec
i
fy da
t
a
t
ype a
s
si
gned charac
t
er
%
s
S
pec
i
fy da
t
a
t
ype a
s
un
si
gned group of
charac
t
er
s
(
St
r
i
ng
s
)
An
y
si
x
fo
rm
a
t
s
pec
i
f
i
e
r
s
with
us
e 1
M
eac
h
22226
[1 of 2] P.T.O.
11920
3 Hours / 70 Marks Seat No.
Instructions : (1) All Questions are compulsory.
(2) Answer each next main Question on a new page.
(3) Illustrate your answers with neat sketches wherever necessary.
(4) Figures to the right indicate full marks.
(5) Assume suitable data, if necessary.
(6) Mobile Phone, Pager and any other Electronic Communication
devices are not permissible in Examination Hall.
Marks
1. Attempt any FIVE of the following : 10
(a) Define array. List its type.
(b) Draw & label different symbols used in flowcharts.
(c) Find the output of the following program :
# include < stdio.h>
void main( )
{
int x = 10, y = 10, v1, v2 ;
v1 = x++ ;
v2 = ++y ;
printf ("value of v1:%d", v1) ;
printf ("value of v2:%d", v2) ;
}
(d) State the syntax & use of strlen ( ) & strcat ( ) function.
(e) State the Relational operators with example.
(f) State the syntax to declare pointer variable with example.
(g) Draw flow chart for addition of two numbers.
22226 [2 of 2]
2. Attempt any THREE of the following : 12
(a) State the importance of flow chart.
(b) Write a program to declare structure student having rollno, name & marks.
Accept & display data for 3 students.
(c) Explain pointer arithmetic with example.
(d) Explain nested if-else with example.
3. Attempt any THREE of the following : 12
(a) Describe the following terms :
(i) Keyword
(ii) Identifier
(iii) Variable
(iv) Constant
(b) Differentiate between call by value and call by reference.
(c) Explain conditional operator with example.
(d) List the categories of functions and explain any one with example.
4. Attempt any THREE of the following : 12
(a) Write an algorithm to determine the given number is odd or even.
(b) Illustrate the use of break and continue statement with example.
(c) Write a program to add, subtract, multiply and divide two numbers, accepted
from user using switch case.
(d) Illustrate initialization of two dimensional array with example.
(e) Write a program to read two strings and find whether they are equal or not.
5. Attempt any TWO of the following : 12
(a) Write a program to calculate sum of all the odd numbers between 1 to 20.
(b) Write a program for addition of two 3 3 matrices.
(c) Write a program to compute the sum of all elements stored in an array using
pointers.
6. Attempt any TWO of the following : 12
(a) Write a program to sort elements of an array in ascending order.
(b) Write a function to print Fibonacci series starting from 0, 1.
(c) Calculate factorial of a number using recursion.
_______________
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 1 / 17
22226
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the model
answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try to
assess the understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more Importance
(Not applicable for subject English and Communication Skills).
4) While assessing figures, examiner may give credit for principal components indicated in the
figure. The figures drawn by candidate and model answer may vary. The examiner may give
credit for any equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant
values may vary and there may be some difference in the candidate’s answers and model
answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant
answer based on candidate’s understanding.
7) For programming language papers, credit may be given to any other program based on
equivalent concept.
Q.
No
.
Sub
Q.N.
Marking
Scheme
1.
(a)
Ans.
10
2M
Definitio
n 1M
Types
1M
(b)
Ans.
Symbol
Name
Function
Start/end
An oval represents a start or end
point
Arrows
A line is a connector that shows
relationships between the
representative shapes
2M
Any 4
symbols
½M
each
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 2 / 17
22226
Input/Output
A parallelogram represents input
or output
Process
A rectangle represents a process
Decision
A diamond indicates a decision
(c)
Ans.
2M
Correct
output
2M
(d)
Ans.
2M
1M for
correct
syntax
1M for
use
(e)
Ans.
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 3 / 17
22226
Any
four
operator
s ½M
each
(f)
Ans.
2M
Correct
syntax
1M
Correct
example
1M
(g)
Ans.
2M
Correct
sequenc
e 1M
Correct
symbol
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 4 / 17
22226
2.
(a)
Ans.
12
4M
Any 4
points
1M each
(b)
Ans.
4M
Correct
logic 3M
Correct
syntax
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 5 / 17
22226
(c)
Ans.
4M
Any two
operator
s
Each
operator
with
explanat
ion 1M
1M for
each
example
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 6 / 17
22226
(d)
Ans.
4M
Explana
tion 2M
Example
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 7 / 17
22226
3.
(a)
Ans.
12
4M
Each
term 1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 8 / 17
22226
(b)
Ans.
Sr.
No.
Call by value
Call by reference
1
When function is called
by passing values then it
is call by value
When function is called by
passing address of variable then
it is called as call by reference.
2
Copy of actual variable is
created when function is
called.
No copy is generated for actual
variable rather address of actual
variable is passed.
3
In call by value, memory
required is more as copy
of variable is created.
In call by reference, memory
required is less as there is no
copy of actual variables.
4
Example:-
Function call -
Swap ( x,y);
Calling swap function by
passing
values.
Example:-
Function call
Swap ( &x, &y );
Calling swap function by
passing
address.
5
Original (actual)
parameters do not change.
Changes take place on the
copy of variable.
Actual parameters change as
function operates on value
stored at the address.
4M
Any
four
differen
ces 1M
each
(c)
Ans.
4M
Explana
tion 2M
Example
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 9 / 17
22226
2M
(d)
Ans.
4M
List 2M
Explana
tion of
any one
category
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 10 / 17
22226
4.
(a)
Ans.
12
4M
Correct
algorith
m 4M
(b)
4M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 11 / 17
22226
Ans.
Use of
each 1M
Example
of each
1M
(c)
Ans.
4M
Correct
logic 2M
Correct
syntax
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 12 / 17
22226
(d)
Ans.
4M
Two dim
array
1M
Declarat
ion 1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 13 / 17
22226
Initializ
ation by
any one
type 1M
Example
1M
(e)
Ans.
4M
Correct
logic 2M
Correct
syntax
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 14 / 17
22226
5.
(a)
Ans.
12
6M
Finding
odd
numbers
2M
Calculat
ing sum
1M
Display
sum 1M
Correct
syntax
2M
(b)
Ans.
6M
Decelera
tion of
variable
s 1M
Input
matrices
2M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 15 / 17
22226
Calculat
ing
addition
2M
Display
addition
1M
(c)
Ans.
6M
Variable
declarati
on 1M
Input
array
1M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 16 / 17
22226
Pointer
Initializ
ation
1M
Sum
calculati
on 2M
Display
1M
6.
(a)
Ans.
12
6M
Input
array
1M
Sorting
logic 4M
Display
sorted
list 1M
(b)
6M
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
WINTER 2019 EXAMINATION
MODEL ANSWER
Subject: Programming in 'C' Subject Code:
Page 17 / 17
22226
Ans.
Correct
function
with
syntax
6M
(c)
Ans.
6M
Recursiv
e
function
4M
Main
function
2M