Sie sind auf Seite 1von 7

Name :

/q
p:/
htt

Roll No. : ....


Invigilator's Signature : ..

CS/B.TECH(NEW)/SEM-2/CS-201/2013

2013

BASIC COMPUTATION AND PRINCIPLES OF


COMPUTER PROGRAMMING

Time Allotted : 3 Hours

Full Marks : 70

pap

The figures in the margin indicate full marks.


Candidates are required to give their answers in their own words
as far as practicable.

wb
er.
GROUP A

( Multiple Choice Type Questions )


1.

Choose the correct alternatives for the following :

i)

10

1 = 10

The correct syntax to send an array "array" as a

in
a c.
ut .

parameter to function "func" is

2266

a)

func ( & array ) ;

b)

func ( array ) ;

c)

func ( * array ) ;

d)

1func ( array [ size ] ); .

[ Turn over

CS/B.TECH(NEW)/SEM-2/CS-201/2013
ii)

What is the output of this C code ?

/q
p:/
htt

# include < stdio.h >


void main ( )
{

double k = 0;
for ( k = 0.0; k < 3.0; k ++ );
printf ( "% f", k );

4.000000

c)

3.000000

d)

none of these.

Number of bytes required to store a float variable is


a)

8 bytes

b)

4 bytes

c)

2 bytes

d)

6 bytes.

The
Hexadecimal
equivalent
( 101101010010 ) 2 is
a)

A53

b)

A52

c)

B52

d)

C62.

of

the

number

in
a c.
ut .

2266

b)

wb
er.

iv)

2.000000

pap

iii)

a)

CS/B.TECH(NEW)/SEM-2/CS-201/2013
v)

The value of EOF is

/q
p:/
htt
vi)

a)

b)

c)

d)

10.

Which of the following are themselves a collection of


different data types ?
String

b)

Structure

c)

Char

d)

All of these.

wb
er.

pap

vii)

a)

A 64 bit microprocessor has word length equal to


a)

1 byte

b)

8 bytes

c)

2 bytes

d)

4 bytes.

operator ?

2266

a)

&&

b)

if

c)

<=

d)

?.
3

in
a c.
ut .

viii) Which one of the following is a ternary conditional

[ Turn over

CS/B.TECH(NEW)/SEM-2/CS-201/2013
ix)

Obtain the 2's complement for '1001' in twice.

/q
p:/
htt
x)

a)

1000

b)

1011

c)

1001

d)

1111.

Find out the output :


main ( ) {

pap

int i = 1;

printf ( "\n % d % d % d" i, ++ i, i ++ ) ; }


331

b)

133

c)

314

d)

111.

wb
er.

a)

GROUP B

( Short Answer Type Questions )


Answer any three of the following.
a)

b)
3.

5 = 15

in
a c.
ut .

2.

Write a flowchart to find the sum of the first n prime


numbers, where n should be given by the user.

What is logical operator ?

Write a program in C to print the sum of the following series


( upto n terms where n should be given by the user ) :
1 + 2 2 / 2! + 3 3 / 3! + ....

2266

CS/B.TECH(NEW)/SEM-2/CS-201/2013
4.

Given two numbers write a program in C to find the HCF in

/q
p:/
htt
recursive way.

5.

6.

a)

What is type casting ?

b)

Indicate the difference between a structure and union.

a)

What are the advantages of 2's complement over 1's


complement ?

pap

b)

Perform the subtraction with the following binary


numbers using 2's complement and 1's complement
respectively :

2+2

wb
er.

i)

11010 1101

ii)

10010 10011.

GROUP C

( Long Answer Type Questions )

7.

a)

Write a program to input a n

maximum element of the matrix.

2266

15 = 45

Input two strings and pass them to a user defined


function to compare them.

b)

in
a c.
ut .

Answer any three of the following.

n matrix and print the

[ Turn over

CS/B.TECH(NEW)/SEM-2/CS-201/2013
8.

a)

Differentiate between Complier and Interpreter.

/q
p:/
htt
b)

c)

9.

i)

Decimal 225.225 to binary.

ii)

Binary 11010111.110 to octal.

iii)

Hexadecimal 2AC5.D to binary.

Why is NAND gate called Universal gate ? Explain with

pap

d)

Convert the following numbers as indicated :

example.

What is bit-wise operator ?

What is a function ? What are the advantages of using

wb
er.

functions ? What are the function prototypes ? Write a


C program to find out the number of vowels in a string.
Explain call by value and call by reference with example.
2+2+2+5+4

in
a c.
ut .

10. Write a C program to find the real roots of the quadratic

equation using user define function quad ( ). What is array of


pointers ? Explain with example. Why is a NOR gate called a
universal gate ?

Simplify ( A + B ) . ( A. C ) + ( A. B + A . C ). ( A + B )

6+4+2+3

2266

CS/B.TECH(NEW)/SEM-2/CS-201/2013
11. Write short notes on any three of the following :

/q
p:/
htt
i)

Relational Operators

ii)

Array of Pointers

iii)

Macro

iv)

Dynamic Memory Allocation

v)

XOR gate.

wb
er.

pap
7

in
a c.
ut .

2266

[ Turn over

Das könnte Ihnen auch gefallen