VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015
-
Upload
vtunotesbysree -
Category
Engineering
-
view
1.222 -
download
12
Transcript of VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015
![Page 1: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/1.jpg)
SOLVED PAPERS
OF
PROGRAMMING IN C &
DATA STRUCTURES
(JUNE-2015 & DECEMBER-2015)
![Page 2: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/2.jpg)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 3: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/3.jpg)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 4: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/4.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
1
1 a. What are data types? Mention the different data types supported by C language,
giving an example to each. (5 Marks)
Ans:
1 b. Write a C program which takes as input p, t, r. Compute the simple interest and
display the result. (5 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 5: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/5.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
2
1 c. What is an operator? List and explain various types of operators. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 6: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/6.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
3
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 7: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/7.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
4
2 a. What is a token? What are the different types of tokens available in C language?
Explain. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 8: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/8.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
5
2 b. Write C expressions corresponding to the following (Assume all quantities are of
same type) (06 Marks)
Ans:
2 c. What is the value of ‘x’ in the following code segments? Justify your answers:
(06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 9: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/9.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
6
3 a. What are the different types of conditional decision making statements? Explain
each with example. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 10: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/10.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
7
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 11: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/11.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
8
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 12: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/12.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
9
3 b. Write a C program to simulate simple calculator that performs arithmetic
operations using switch statements. Error message should be displayed, if any
attempt is to made to divide by zero. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 13: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/13.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
10
4 a. Explain with example formatted input output statements in C. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 14: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/14.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
11
4 b. List four differences between while loop and do-while loop along with syntax
and example. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 15: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/15.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
12
4 c. Design and develop a C program to reverse a given four digit integer number
and check whether it is a palindrome or not. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 16: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/16.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
13
5 a. What is an array? Explain different methods of initialization of single
dimensional arrays. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 17: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/17.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
14
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 18: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/18.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
15
5 b. Write a C program to read N integers into an array A and to
i) find the sum of odd numbers
ii) find the sum of even numbers
iii) find the average of all numbers
Output the results computed with appropriate headings. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 19: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/19.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
16
5 c. How string is declared and initialized? Explain any FOUR string manipulation
functions with examples. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 20: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/20.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
17
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 21: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/21.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
18
6 a. Explain function call, function definition and function prototype with examples
to each. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 22: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/22.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
19
6 b. What are actual parameters and formal parameters? Illustrate with example.
(06 Marks)
Ans:
6 c. What is recursion? Write a C program to compute the factorial of a given number
‘n’ using recursion. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 23: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/23.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
20
7 a. How structure is different from an array? Explain declaration of a structure with
an example. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 24: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/24.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
21
7 b. Explain with an example, how to create a structure using ‘typedef’. (04 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 25: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/25.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
22
7 c. Write a C program to input the following details of ‘N’ students using structure:
Roll No: integer, name: string, marks: float, grade: char
Print the names of the students with marks >= 60.0%. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 26: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/26.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
23
8 a. Explain following file operations along with syntax and examples:
i)fopen() ii)fclose() iii)fscanf() iv) fprintf() v)fgets(). (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 27: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/27.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
24
8 b. Write a C program to read the contents from the file called abc: text, count the
number of characters, number of lines and number of white spaces and output the
same. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 28: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/28.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
25
8 a. Define pointer variable. Explain with an example, the declaration and
initialization of pointer variable. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 29: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/29.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
26
8 b. Explain following C functions along with syntax and example to each.
i) malloc() ii) calloc() iii) realloc iv) free() (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 30: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/30.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
27
8 c. Develop a C program to read two numbers and function to swap these numbers
using pointers. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 31: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/31.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
28
10 . Write short notes on following:
a. Preprocessor directives
b. Primitive and non primitive data types
c. Stack operations
d. Types of queues. (20 Marks)
Ans:
a)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 32: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/32.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
29
Ans:
b)
Ans:
c)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 33: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/33.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER JUNE- 2015
30
Ans:
d)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 34: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/34.jpg)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 35: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/35.jpg)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 36: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/36.jpg)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 37: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/37.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
1
1 a. What are data types? Mention the different data types supported by C language,
giving an example to each. (5 Marks)
Ans:
1 b. Write a C program which takes as input p, t, r. Compute the simple interest and
display the result. (5 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 38: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/38.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
2
1 c. What is an operator? List and explain various types of operators. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 39: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/39.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
3
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 40: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/40.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
4
2 a. What is a token? What are the different types of tokens available in C language?
Explain. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 41: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/41.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
5
2 b. Write C expressions corresponding to the following (Assume all quantities are of
same type) (06 Marks)
Ans:
2 c. What is the value of ‘x’ in the following code segments? Justify your answers:
(06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 42: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/42.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
6
3 a. What are the different types of conditional decision making statements? Explain
each with example. (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 43: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/43.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
7
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 44: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/44.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
8
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 45: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/45.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
9
3 b. Write a C program to simulate simple calculator that performs arithmetic
operations using switch statements. Error message should be displayed, if any
attempt is to made to divide by zero. (10 Marks)
Ans:
4 a. Explain with example formatted input output statements in C. (06 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.1b.
4 b. List four differences between while loop and do-while loop along with syntax
and example. (06 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.4b.
4 c. Design and develop a C program to reverse a given four digit integer number
and check whether it is a palindrome or not. (08 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.4c.
5 a. What is an array? Explain different methods of initialization of single
dimensional arrays. (06 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.5a.
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 46: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/46.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
10
5 b. Write a C program to read N integers into an array A and to
i) find the sum of odd numbers
ii) find the sum of even numbers
iii) find the average of all numbers.
Output the results computed with appropriate headings. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 47: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/47.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
11
5 c. How string is declared and initialized? Explain any FOUR string manipulation
functions with examples. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 48: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/48.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
12
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 49: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/49.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
13
6 a. Explain function call, function definition and function prototype with examples
to each. (06 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 50: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/50.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
14
6 b. What are actual parameters and formal parameters? Illustrate each with
example. (06 Marks)
Ans:
6 c. What is recursion? Write a C program to compute the factorial of a given number
‘n’ using recursion. (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 51: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/51.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
15
7 a. How structure is different from an array? Explain declaration of a structure with
an example. (06 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.7a.
7 b. Explain with an example, how to create a structure using ‘typedef’. (04 Marks)
Ans:
7 c. Write a C program to input the following details of ‘N’ students using structure:
Roll No: integer, Name: string, Marks: float, Grade: char
Print the names of the students with marks >= 60.0%. (10 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.7c.
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 52: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/52.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
16
8 a. Explain following file operations along with syntax and examples:
i)fopen() ii)fclose() iii)fscanf() iv) fprintf() v)fgets(). (10 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 53: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/53.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
17
8 b. Write a C program to read the contents from the file called abc: text, count the
number of characters, number of lines and number of white spaces and output the
same. (10 Marks)
Ans:
9 a. Define pointer variable. Explain with an example, the declaration and
initialization of pointer variable. (06 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.9a.
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 54: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/54.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
18
9 b. Explain following C functions along with syntax and example to each.
i) malloc() ii) calloc() iii) realloc iv) free() (08 Marks)
Ans:
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 55: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/55.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
19
9 c. Develop a C program to read two numbers and function to swap these numbers
using pointers. (06 Marks)
Ans: For answer, refer Solved Paper June-2015 Q.No.10d.
10 . Write short notes on following:
a. Preprocessor directives
b. Primitive and non primitive data types
c. Stack operations
d. Types of queues. (20 Marks)
Ans: a) For answer, refer Solved Paper June-2015 Q.No.10a.
Ans: b) For answer, refer Solved Paper June-2015 Q.No.9b.
Ans: c)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/
![Page 56: VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & DECEMBER-2015](https://reader033.fdocuments.in/reader033/viewer/2022061604/58834d571a28abbe6b8b7185/html5/thumbnails/56.jpg)
PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPER DEC- 2015
20
Ans: d)
For Solved Question Papers of UGC-NET/GATE/SET/PGCET in Computer Science, visit http://victory4sure.weebly.com/