This download link is referred from the post: VTU B.Tech 1st Year Last 10 Years 2011-2021 Question Papers
14PCD13/23
First/Second Semester B.E. Degree Examination, June/July 2015
Programming in C and Data Structures
--- Content provided by FirstRanker.com ---
Time: 3 hrs.
Max. Marks: 100
Note: Answer FIVE questions, selecting ONE full question from each part.
PART-1
- a. What are data types? Mention the different data types supported by C language, giving an example to each. (05 Marks)
--- Content provided by FirstRanker.com ---
b. Write a C program which takes as input p, t, r, compute the simple interest and display the result. (05 Marks)
c. What is an operator? List and explain various types of operators. (10 Marks) - a. What is a token? What are different types of tokens available in C language? Explain. (08 Marks)
b. Write C expressions corresponding to the following (Assume all quantities are of same type):
- A = 5x+3y
- B = √(s(s - a)(s - b)(s - c))
- C = e(x+y-10)
- D = 1/(x+y)
- X = (-b ± √(b² - 4ac)) / 2a
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
c. What is the value of `x` after the following code segments? Justify your answers:
- int a, b;
float x;
a = 4;
b = 5;--- Content provided by FirstRanker.com ---
x = b/a; - int a, b;
float x;
a = 4;
b = 5;--- Content provided by FirstRanker.com ---
x = (float) b/a;
PART-2
- a. What are different types of conditional decision-making statements? Explain each with examples. (10 Marks)
b. Write a C program to simulate a simple calculator that performs arithmetic operations using a switch statement. An error message should be displayed if any attempt is made to divide by zero. (10 Marks) - a. Explain with examples formatted input-output statements in C. (06 Marks)
b. List four differences between while loop and do-while loop along with syntax and example. (06 Marks)
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)
--- Content provided by FirstRanker.com ---
PART-3
- a. What is an array? Explain different methods of initialization of single-dimensional arrays. (06 Marks)
--- Content provided by FirstRanker.com ---
b. Write a C program to read N integers into an array A and to:
- find the sum of odd numbers
- find the sum of even numbers
- find the average of all numbers
--- Content provided by FirstRanker.com ---
c. How is a string declared and initialized? Explain any FOUR string manipulation functions with examples. (08 Marks) - a. Explain function call, function definition, and function prototype with examples to each. (06 Marks)
b. What are actual parameters and formal parameters? Illustrate with an example. (06 Marks)
c. What is recursion? Write a C program to compute the factorial of a given number 'n' using recursion. (08 Marks)
PART-4
--- Content provided by FirstRanker.com ---
- a. How is a structure different from an array? Explain the declaration of a structure with an example. (06 Marks)
b. Explain with an example, how to create a structure using `typedef`. (04 Marks)
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 >= 70.0%. (10 Marks) - a. Explain the following file operations along with syntax and examples:
- fopen()
- fgetc()
- fscanf()
- fprintf()
- fgets()
--- Content provided by FirstRanker.com ---
b. Write a C program to read the contents from the file called abc.txt, count the number of characters, the number of lines, and the number of white spaces, and output the same. (10 Marks)
--- Content provided by FirstRanker.com ---
PART-5
- a. Explain the point variable. Explain with an example, the declaration and initialization of a pointer. (06 Marks)
--- Content provided by FirstRanker.com ---
b. Explain the following C functions along with syntax and example to each:
- malloc()
- calloc()
- realloc()
- free()
--- Content provided by FirstRanker.com ---
c. Develop a C program to read two numbers and function to swap these numbers using pointers. (06 Marks) - Write short notes on the following:
a. Preprocessor directives
b. Primitive and non-primitive data types--- Content provided by FirstRanker.com ---
c. Stack operations
d. Types of queues (20 Marks)
FirstRanker.com
--- Content provided by FirstRanker.com ---
This download link is referred from the post: VTU B.Tech 1st Year Last 10 Years 2011-2021 Question Papers