Printed Pages : 4

ECS2Ol/CSE2O1

(Following Paper ID and Roll No. to be filled in your Answer Book) Roll No.

B. Tech.

(SEMESTER-rr) THEORY EXAMTNATTON,

201 1 -1 2

COMPUTER CONCEPTS & PROGRAMMING IN C Time:3HoursJ

I

Tottrl Marks : 100

Note: Attempt all the Sections. Section

1.

Attempt atl the

(a) (b) (c)

-

A

parts.

In C-programmingwhatwill be the value of r if

q:5?

r:poh

10 x 2 :20 q where p:-I7 and

(d)

Write down any four characteristics of a good programming language. Explain the difference between const char *p and char const *p What is the meaning of scope of variable ? Give various types of sqope in 'C'

(e)

programming. Give the for loop statement to print each of the following sequence of integers

(f) (g)

What is conditional compilation and how does it help a programmer ? ln C-programming what will be the output of the following code ? Explain your

(i) 1,2,4,9,16,32 (ii) 4, -2,0,2, 4

:

answer.

main( ) {

printf("\nab");

printf("\bsi");

)

printf("\rha");

(h) (i)

) What are preprocessor directives ? What is the difference between the following directives ? # include and # inchide "studio.h" Describe the tu,o ways of passing parameters to functions. When do you prefer to use each

0)

ofthem

?

In C-programming what will be the outputs of the following code ? Explain your answer.

printf(tt 7odrt, strcmp(t'push"r ttpull"))1

1602

1

P.T.O.

Scction

2.

3 x 10 :'30 Attempt any three parts in this section. (a) Differentiate between the following : (i) High level language and lorv level ianguage. (ii) Compiler and interpreter. (iii) Logical error and run time error. (iv) Algorithm and flowcharl. (b) (i) Write a program in 'C' in rvhich values of variables x,y,z arc input by user, then their values are rotated such that x has value of y, ;v has vallte of z, z has value of y. (ii) Write a program in 'C' where user input a five digit positive integer and then display it as per example shown : Example : Suppose input nurnber is 24689 and it is to be displayed as

(c) (d)

(e)

3.

-B

24689 4689 689 89 9

infirstline

insecondline in third line in fourth line in iifth line Explain in detail about all the types of loops and conditional statemr.:nt cxist in 'C' programming language. Write a program in 'C' to read a (5x4) nratrix using array aud to calculaie the following: (i) Sum of the elements of the third row of the matrix. (ii) Sum of all the elements of the matrix. Write algorithm and fiinction program to -sort at7 an'ay of integer into descending order, where the size of array is input by user.

Section - C Attempt all questions in this section. 5 x 2 : 10 Attempt any two parts. (a) What is an operating system ? Give name of any four operating systems. Write any five important features of any one type of operating system. (b) For a digital computer explain briefly the follorving : (i) Cache memory (ii) Confiol unit

(iiD ALU

(c)

Perform the following (i) Convert (999)ro

(ii) (iii) (iv) (v) t6o2

:

+(

)ro

Convert (1101 1101)2

+(

)a

Convert (786)ro -+( )nco

Find Two's complement of the nttmber 1100100. Write the decimal value of Two's complement obtained in (iv). 2

4.

lx10:10 Attempt any one part. (a) Explain in detail aborrt the following ; (i) Fundanrenial data types in 'C' ianguage. nrcntioning their range. space they occupy in memory and ktyrord usc,d tbr their representation in programrning. (ii) Four storage class in 'C', mentioning theii place ol storage, default initial value, soopc and litb of each o1' thcnr. (b) Complete the follovring table regarding the operators availahle in 'C' language.

Modulus

__ ____l

Greater than

Bitwise AND Losical OR

i I I I

9sr4,lereErpreqrer -I____-_-_ l--li -L_._________-__ L._

5.

2x5:10 Atternpt any tlvo parts ; (a) Write a program in 'C' using srvitc,h staiement to firrd the value of y for particular value of N. The value of a, x" b, N are to be input tlrrough keyboartl b1' user. IFN: I y:ax9/ob iF N:2 5ax2 + b2 N:3 ),: -_bx IF N:4 y.,s 4.Xlb If

(b)

Explain what is likely to haprpen rvhen thc tbllor.r,ir',g situatinns are cncol',ntered in a prc)gram.

(i) (ii) (iii)

Actual argumer-rts are less than the fomral arguruents in a fuirctiun. Data type of one of the actual arguments does r-iot match u,ith the type of the coresponding fonnal argnment. The order of actual parameters in the function cail is different from the order of {brrnal pararneters in a function rvhere all the paramefers are of the same,type.

(iv) (c)

The type ol'expression used in return staternent does not match.with the type of the function. Write a program in 'C' to print thc foilowing : I

22

333

4444 55555 1602

P.T.O.

6.

1x10:10

Attempt any one part.

(a)

Define a structure called cricket that will describe the following information

:

player name team name

batting average Using cricket, declare an array player with 50 elements and write a program to read the information about all the 50 players and print a team-wise list containing names of players with their batting average.

(b)

Explain the following

(i) (ii) (iii) (iv) 7.

Dynamic memory allocation.

malloc and calloc. Stack.

Linked list.

Attempt any one

(a) (b)

:

I x 10 :

part.

10

Write a program which will read a string and rewrite it in the alphabetical order. For example the word STRING should be written as GINRST. Given high level VO functions for file management in C, complete the following table.

S.No.

1602

Function Name Operation

I

fopen0

2.

getc0

-).

putc0

4.

fprint0

5.

getw0

6.

putw0

7.

fseekQ

8.

ftell0

9.

fscanf0

10.

rewind0

Syntax of function

21,200

UPTU B.Tech Computer Concepts & Programming in C ECS 201 ...

UPTU B.Tech Computer Concepts & Programming in C ECS 201 ECS201 Sem 3_2011-12.pdf. UPTU B.Tech Computer Concepts & Programming in C ECS 201 ...

2MB Sizes 6 Downloads 159 Views

Recommend Documents

UPTU B.Tech Computer Concepts & Programming in C-ECS-201 ...
UPTU B.Tech Computer Concepts & Programming in C-ECS-201 sem 2_ 2009-10.pdf. UPTU B.Tech Computer Concepts & Programming in C-ECS-201 sem 2_ ...

UPTU B.Tech ECS-201 Computer Concepts And Programming in C ...
UPTU B.Tech ECS-201 Computer Concepts And Programming in C sem 2_ 2010-11.pdf. UPTU B.Tech ECS-201 Computer Concepts And Programming in C ...

UPTU B.Tech Computer Concepts & Programming in C-ECS-101 ...
UPTU B.Tech Computer Concepts & Programming in C-ECS-101 Sem 1_2009-10.pdf. UPTU B.Tech Computer Concepts & Programming in C-ECS-101 Sem ...

UPTU B.Tech Computer Graphics ECS-504 Sem 5_2013-14.pdf ...
terms Pixel, Aspect Ratio, Resolution. O) Develop and write mid point circle algorithm. Apply it to. predict the pixels in any octant for the circle whose centre.

UPTU B.Tech Computer Graphics ECS-504 Sem 5_2014-15.pdf ...
ll0s041 3 16675. Page 3 of 3. UPTU B.Tech Computer Graphics ECS-504 Sem 5_2014-15.pdf. UPTU B.Tech Computer Graphics ECS-504 Sem 5_2014-15.pdf.

UPTU B.Tech Distributed Systems ECS-701 Sem 7_2011-12.pdf ...
Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying... Download. Connect more ...

UPTU B.Tech Operating System ECS-501 Sem 5_2014-15.pdf ...
UPTU B.Tech Operating System ECS-501 Sem 5_2014-15.pdf. UPTU B.Tech Operating System ECS-501 Sem 5_2014-15.pdf. Open. Extract. Open with. Sign In.

UPTU B.Tech Operatin System ECS- 501 Sem 5_2011-12.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. UPTU B.Tech ...

UPTU B.Tech ECS-602 Software Engineering Sem 6_2010-11.pdf ...
UPTU B.Tech ECS-602 Software Engineering Sem 6_2010-11.pdf. UPTU B.Tech ECS-602 Software Engineering Sem 6_2010-11.pdf. Open. Extract. Open with.

UPTU B.Tech Pattern Recognition ECS-074 Sem 7_2013-14.pdf ...
UPTU B.Tech Pattern Recognition ECS-074 Sem 7_2013-14.pdf. UPTU B.Tech Pattern Recognition ECS-074 Sem 7_2013-14.pdf. Open. Extract. Open with.

UPTU B.Tech Database Management System-ECS-402 Sem 4_2009 ...
UPTU B.Tech Database Management System-ECS-402 Sem 4_2009-10.pdf. UPTU B.Tech Database Management System-ECS-402 Sem 4_2009-10.pdf. Open.

UPTU B.Tech IT Infrastructure and Its Managenent -ECS-304 Sem ...
UPTU B.Tech IT Infrastructure and Its Managenent -ECS-304 Sem 3_2010-11.pdf. UPTU B.Tech IT Infrastructure and Its Managenent -ECS-304 Sem ...

UPTU B.Tech Parallel Algorithms ECS 073 Sem 7_2011-12.pdf ...
UPTU B.Tech Parallel Algorithms ECS 073 Sem 7_2011-12.pdf. UPTU B.Tech Parallel Algorithms ECS 073 Sem 7_2011-12.pdf. Open. Extract. Open with.

UPTU B.Tech Pattern Recognition ECS 074 Sem 7_2011-12.pdf ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. UPTU B.Tech ...

UPTU B.Tech Computational Complexity ECS 072 Sem 7_2011-12 ...
UPTU B.Tech Computational Complexity ECS 072 Sem 7_2011-12.pdf. UPTU B.Tech Computational Complexity ECS 072 Sem 7_2011-12.pdf. Open. Extract.

UPTU B.Tech Data Compression ECS 077 Sem 7_2011-12.pdf ...
UPTU B.Tech Data Compression ECS 077 Sem 7_2011-12.pdf. UPTU B.Tech Data Compression ECS 077 Sem 7_2011-12.pdf. Open. Extract. Open with.

UPTU B.Tech Pattern Recognition ECS-074 Sem 7_2015-16.pdf ...
There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. UPTU B.Tech Pattern Recognition ECS-074 Sem 7_20

UPTU B.Tech Operating System ECS-501 Sem 5_2014-15.pdf ...
(e) Enumerate the 'advantages of the layered. approach to system design? Also, Explain. virtual machine architecture in detail. (0 What are Sernaphores?

UPTU B.Tech Object Oriented Systems- ECS-305 Sem 3_2010-11 ...
Page 3 of 4. UPTU B.Tech Object Oriented Systems- ECS-305 Sem 3_2010-11.pdf. UPTU B.Tech Object Oriented Systems- ECS-305 Sem 3_2010-11.pdf. Open.

UPTU B.Tech Operating System ECS-501 Sem 5_2013-14.pdf ...
UPTU B.Tech Operating System ECS-501 Sem 5_2013-14.pdf. UPTU B.Tech Operating System ECS-501 Sem 5_2013-14.pdf. Open. Extract. Open with. Sign In.

Concepts, Techniques, and Models of Computer Programming
Jun 5, 2003 - 2.1 Defining practical programming languages . . . . . . . . . . . . . 33 .... 3 Declarative Programming Techniques. 113 ... 3.7.3 A word frequency application . ...... an Apple Macintosh PowerBook G4 with Mac OS X and X11. The first ..