pyq_c(2023)
pyq_c(2023)
March 2024
we
2235
COMPUTER PROGRAMMING IN C
Answer to Question No. 1 of Group A is compulsory and to he answered first. This answer is to
be made in separate loose script(s) provided for the purpose. Maximum time allowed is 30 minutes, after
which the loose answer scripts will be collected and fresh answer scripts for answering the remaining pert
of the question will be provided. On early submission of answer scripts of Question No. 1, a student will
get the remaining script earlier.
Answer any Five (05) Questions from Group B.
Group A
1. Choose the correct answer from the given alternatives (any twenty): 1x20
i) Which is the correct way to declare a pointer?
a) int_ptr x b) int *ptr c) *int ptr d) none
ti) What is the size of the int data type (in bytes) in C?
a)4 b)8 c)2 d)l
iii) How is an array initialized in C language?
a) int a[3] = {1, 2, 3}; b) int a = {1, 2, 3};
¢) int a{] = new int[3]; d) int a(3) = [1, 2, 3];
iv) A function - F
(a) may or may not need input data (b) may or may not return a value
(c) Both a and b (d) None of these
v) How will you print \n on the screen?
a) printf(“\n”) b)echo“\n” cc) printf{‘\n’) __d) printf{“\\n”)
vi) If p is an integer pointer with a value 1000, then what will the value of p + 5 be?
a) 1020 b)1005 c)1004 d)1010
vii) Which of the following are not standard header files in C?
a) stdio.h b) stdlib.h c) conio.h d) None of the above
vili) | What is the output of the following code snippet?
#include <stdio.h>
ie main()
int a[] = {1,2, 3, 4};
int sum = 0;
for(inti = 0; i < 4; i++)
{
sum += a{i];
}
printf("%d", sum);
return 0;
}
a)! b)4 c) 20 d) 10
a) 2 b) 15 c) 16 d) 18
- “7
a4
3
d) None of the above
p?
it controlled looop
ae.
ing is an er do-while Jon
io in Cc?
the follb)owfor Lay
h e ofloop handle recurs
x) a)whiwhcil
e +) Dqueue specie er | Cc?
fis
Which data structur es atic
xi)
: in g is N° a st or ale ee Pe st
ow
xii) 0) Sof the follel tel e Dy , 5
d) Rasm us Letdors
Apar t DabenlenisnamRietc? hie
.
age:
CAE al n
5 te
vari
WhoStievs e thJoe fit b) ofJames 70S e
J
d
xiii) a) count; 4) int $main;
Mee ee
letters d) expo rt
¢) CamelCase g ca nn o °) fen
owin :
chich ofof the the f fo Hl
WhiTh
ed
b)$ then it 1S call
a) #
fu nc ti on re tu rns no value in g fu nc ti on
xviii) If the ti on b) Call
nc on
a) Data type fu d) Void functi
c) Main function
are 37 keywords
In c compiler there
32 ke yw or ds C) 31 keywords d)
a) 30 keywords ) _— operator.
xx) && is a/an__ ical
_
c) Uninor d) Bitwise AND
a) arit hm et ic ) log
with
ent cannot be used d) all of these
xxi) | The continue statem tch c) whi le
. a) for b) swi
.c file int o
xxii) Compiler converts the ©) lib file d) batch file
file a) obj file function i
oe ay
d use d to tra nsf er con tro l fro m a function back to the calling Aecppecmitt,
e keywor c) go back d) return 7
a) switch b) goto P
xiv) What is the output? i
int a=5,b;
b=at+;
: baaod % Ad”, a,b);
b) 66 c) 55
a) 65 n the value of x%y is
os :
xxv) ma 2 and y= 3 the )
: b) ) 2 c)1 d) None of these
Group B
numbers. 44
mmon Divisor) of two
Write a
Write Ee
;
ae is the GCD (Greatest Co
b)a) iL a not : py.
a nu mb er is di visible by 5 and
check whether example .
345.
ifferentiate
Diff p us ing suitablesubj
be ) noe a ee a
ms i a e loo
marks of fiv
e e
b)
on and kee gegop
gorithms, Pyth zation. cues pa
_Syst_Organi pe
according to following: adeComp
A
: Gr
Percentage >= 90% ade B
Gr
Percentage >= 80% :
70 % : Grade C
Percentage >= e
Percentage >= 60% : Grad
dee F E
eeceeno<tp40%ea:gGraom
e
a) What is the use of goto statement? Give suitable exampl e. 3+5
b) Print the patterns using nested loops ge
5
45
a) Explain the following string operations using in C (i) stremp () (ii) streatQ) 3+5
use string.h]
b) Write a C program to convert lowercase string to uppercase and vice versa. [Do-Not
5+(1+2)
a) Write a program in C to add two numbers using pointers and function.
b) What is pointer? State advantages of using pointer in C
3+5
a) Write a program in C to find ASCII value of a character.
interval using functions.
b) Write a program in C to find all prime numbers between given
realloc() d) free(Q) 24+2+2+2
10. Explain with example a) malloc() b) calloc() c)