CST 3 Sem Computer Programmin in C 307 1 N Jun 2022
CST 3 Sem Computer Programmin in C 307 1 N Jun 2022
307/1(N)
cOMPUTER PROGRAMMING IN C
Time Allowed: 3 Hours Full Marks: 60
r the following questions from Group-A, B & C as directed.
GROUP-A
1. Choose the correct alternative (Any ten) Ix10-10
a) Object oriented language b) High level language c) Assembly:language d)
i)C is often called a
bb c)\m d)n.
with different scope. b) A single
iv) Which is false? a) A variable defined once can be defined again
declared and
in the same scope. c) A variable must be
variable cannot be defined with two different types
location in memory.
defined at the same time. d) A variable refers to a
int i= -5;
int k = i %4;
printf("%dn", k);
None
a) Compile time error b) -1 c) d)
1
forever b) c) 0
forg = 1;j =10;j=j-1)? A)
never
execute
How many times will the following loop
x)
d) 1
main)
int r, x = 2;
float y= S5;
r= y%x;
printf(%d", r);
c) 2 d) Compile error
a)1 b) 0
1
xii) The machine registers are sometimes called a) local variables b) global variables c) accumulators
d) static variables
i) What is keywords?
i) What is prototype declaration of a function?
ii) What do you mean by library function in C program?
iv) What do you mean by debugging?
vWhat is the difference between declaring a header file with and *2
vi) What is the use ofa "\0° character?
vii) What is a syntax error?
vii) What is token?
ix) Write the difference between and== in C
x) What is global variable?
=
programming.
xi) What is malloc ()?
xi) What is typecasting?
xiv) What is the job of Assembler in C
xv) What are macros? programming?
GROUP-B
4. Answer the
questions (Any six) 2x6-12
i) What is Bit wise operation in C?
ii) What is header file?
ii) Write down the advantage of the Structured
program.
iv) State the types of User-Defined Functions.
2
v)What is the difference between do-while and while loop?
vi) Evaluate c=at++--b-at++b where a=8,b=4.
vii) Convert (167) base 10 to binary.
vi) Explain size of operator with example
ix) Write the differences between Compiler and
x) Name the types of Arrays.
Interpreter
xi) What is looping in C?
xii) Differentiate Source Codes from Object Codes.
GROUP-C
5. Answer the question (any one) 6x1
a) What do you mean by associativity of an operator? Explain break and continue statement with an
example.
b) Write a program to calculate GCD of two numbers. Why goto statement should be avoided in c?
c)What do you mean by nested loop structure? b) Write a program in C to find the sum of the series
1+(1+2) +(1 +2 +3) +. . up to 'n' terms, the value of 'n' should be given from the keyboard.
a) Discuss with programming examples the different types of String Handling Function in C.
a) What do you mean by a pointer to a function? Write a C program to access a one dimensional array
using pointer.
b) Write a recursive function to obtain the returning sum of first 25 natural numbers. Write a program to
find weather a year is leap year or not
c)Write ac program for reading and writing some integer value using the concept of Dynamic Memory
Allocation.