VTU First Year Engineering (C Cycle) (Semester 2)
Programming in C and Data Structures
December 2015
Programming in C and Data Structures
December 2015
1 (a)
Explain the structure of 'C' program with example.
8 M
1 (b)
Explain scanf() and printf() function in 'C' language with syntax and examples.
8 M
1 (c)
Write a 'C' program to find area of circle.
4 M
2 (a)
What is an Algorithm? Write an algorithm to find largest of 3 numbers.
8 M
2 (b)
Explain the following operators in 'C' language:
i) Relational ii) Logical iii) Conditional.
i) Relational ii) Logical iii) Conditional.
8 M
2 (c)
What is an Identifier? Give any 5 rules that are to be followed, while declaring a variable.
4 M
3 (a)
Explain the ELSE-IF ladder with syntax and example.
8 M
3 (b)
List the types of loops. Explain the working of any one type of loop with syntax and example.
8 M
3 (c)
Write a program to read a year as an input and find whether it is a LEAP YEAR or not.
4 M
4 (a)
Explain SWITCH statement, with syntax and example.
8 M
4 (b)
Differentiate between WHILE and DO-WHILE loops.
6 M
4 (c)
Write a program to find reverse of a number and check whether it is a PALINDROME or not.
6 M
5 (a)
What is an ARRAY? Explain the different ways of initializing an array with examples.
7 M
5 (b)
What are the advantages of using User-Defined functions?
6 M
5 (c)
Write a program to read a sentence and print the frequencies of each VOWEL and total count of CONSONANTS.
7 M
6 (a)
Explain the different types of arrays, with syntax and examples.
7 M
6 (b)
Explain any 4 string manipulating functions with examples.
8 M
6 (c)
Define the following: i) Actual parameter ii) Formal parameter iii) Global variable iv) Local variable.
5 M
7 (a)
Define a STRUCTURE. Explain structure with syntax and example.
5 M
7 (b)
What is a FILE? Explain any 2? FILE functions, with example.
5 M
7 (c)
Write a program to maintain a record of ?n? student details using an array of structures with four fields (Roll number, Name, Marks and Grade). Each field is of a appropriate data type. Print the marks of the student give student name as input.
10 M
8 (a)
Differentiate between STRUCTURES and UNIONS.
5 M
8 (b)
Explain the various MODES in which a FILE can be created successfully.
5 M
8 (c)
Given 2 university information files 'studentname.txt' and 'usn.txt' that contains students students Name and USN respectively. Write a program to create a new file called ?output.txt? and copy and contents of files 'studentname.txt' and 'usn.txt' into output file in the sequence shown below:
Student Name | USN |
Name - 1 | USN - 1 |
Name - 2 | USN - 2 |
. . . . |
. . . . |
10 M
9 (a)
Define a POINTER. Explain how pointer variable is declared and initialized.
6 M
9 (b)
What are primitive and non-primitive data types? Give examples.
6 M
9 (c)
Write a program using pointers to compute sum. Mean and standard deviation of all elements stored in an array of 'n' real numbers.
8 M
10 (a)
Explain any 2 pre-processor directives in 'C' language.
5 M
10 (b)
What is a STACK? Explain its applications.
5 M
10 (c)
What is a QUEUE? Explain with example.
5 M
10 (d)
Write a program to swap 2 numbers using call - by - reference method.
5 M
More question papers from Programming in C and Data Structures