How To Exam?

a knowledge trading engine...


Thapar University 2006 B.E Computer Science Computer Programming - Question Paper

Thursday, 18 April 2013 10:00Web


Thapar Institute of Engineering & Technology
B.E. CSE (1st Year)
Final Term exam
TA103 (Computer Programming )

hapar Institute of ICngineering & Technology, Patiala Computer Science & Engineering Department I.K. Year, Is' Semester I Cud Semester ICxam

V AJp u (

eft ;



Date: 05.12.2006(09:00) Time Allowed: 3 11rs. Max. Marks: 36


Course Code: TA 103

Course Name: Computer Programming

Instructor: AV. SCO. RK


Note: I. Attempt any six questions. 2. Attempt ail sub parts of a question at one place.

3.    Only First six questions will be evaluated.

4.    Write your tutorial group number on top right of vour answer sheets.

Ql : (a) What is difference between \x and **xv? ICxplain in detail.    2

(b)    What is difference between user defined function and library functions? ICxplain with examples.    2

(c)    Discuss in detail any iwo differences between text and binary files.    2

ICxplain sarious types of loop control statements in C with proper examples.    3

ICxplain the function of strcal(). strrev( ), slrcmpO with examples?    3

What are the function performed by the fseeki) and nnvimfO? ICxplain with examples.    2

I low are structure elements accessed using pointers? ICxplain with example.    2

What do you mean by nesting of structures? Discuss with example?    2


Q2: (


a)

(b)


Q3: (a)

(h)

(c)

Q4: What is the output of the following programs? Explain. (Ignore any syntax error).


1.5 x 4=6


main()

{

}

ini sum(int n)

{

if( n < I ) return n: else return(n+sum(n-l));

}


maini)


prinlf{"%d'\sum(5)):


ini i. b( I 1.2. 3. 4. 5},*p: p-b;

* i *p:

printf{"%d".*p); p i -2:

printf("%d\*p);


}


int'i=3, a=l, b-1; void funcQ

main()


ini i 0:

for( i (hi<20;i++)


ini a -0: sialic ini b=(); a++; b- +:


switch(i)


}

main()

{


ease 0: i+=5; case I : i+=2; case 5: i+=5: default i+=4; break:

printf("%d\i):


for( i~0;i<20;i++)

func( ):

a++: b++:

i

i

printf("a- %d . b-%d ,a,b);

main()

{

main()


i

int x|5| = { 0. I, 2, 3. 4. 5};

int *p;

p=x+3;

printf(l%d \nM. p-2);

}


int a=10;

int sum(int ini. int );

printl[%d,sum(a++,+-t-a,++a));

int sum(ini a, ini b, int c)

{

return (a+b-c);

j_ _

main()

{

char *sl = "ABCDE"; char *s2 = "AB"; whilc(*sl = =*s2) i

if(* si - VO'|| *s2 = = *\0'> break;

sl++ ; s2++;

}

if(*s2 = = '\0') printf(M0M) ; else prinlfC'-l");

>_ __ main()

{

int xfl = {1,2.3}; int *xpoint: unsigned m=0.n=3: xpoint = x; for (; m < n ; printf("%d%d%d%d%d\n". *x. *(x +m), * (x + m) + l,*xpoint, (xpoint * m));

}


Q6: Given a text file containing some text. Write a program to read ihe texl file in reverse, character by character and write it into another file, (for example if text in the file is he is coming then contents of another file should be: gnimoc si eh)    6

Q7: W'rite a general purpose function, using poinler, that reccivc a character string and a character as argument and deletes all occurrences of this character in this siring. The function should return the corrected string with no spaces, (for example: if input string is amit bansal and input characterj be deleted is a*, then the output will be: mitbnsl)    6

Note: Group A1-A5 can sec their evaluated answer sheets on 09-12-2006 in Room No. B208. Group B1-B5 can see their evaluated answer sheets on 09-12-2006 in Room No. B209. Group C1-C5 can see their evaluated answer sheets on 09-12-2006 in Room No. CCCT Lab.

l ime is 12 - 2 p.m.







Attachment:

( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Thapar University 2006 B.E Computer Science Computer Programming - Question Paper