MORE IN Programming in C and Data Structures
VTU First Year Engineering (C Cycle) (Semester 1)
Programming in C and Data Structures
December 2014
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary

1 (a) What is pseudocode? Explain with an example.
4 M
1 (b) Explain the structure of C program with an example.
6 M
1 (c) Explain any five operators used in C language.
10 M

2 (a) What is type conversion? Explain two types of type conversions with examples.
6 M
2 (b) Write a program in C to find the area and perimeter of a rectangle.
6 M
2 (c) Define: i) Variable ii) Constant iii) Associativity iv) Precedence.
8 M

3 (a) What is two way selection statement? Explain if, if-else, nested if-else casaded if-else with example and syntax.
10 M
3 (b) Write a program that takes three coefficients (a, b and c) of a quadratic equation: (ax2+bx+c)1 as input and compute all possible roots and print them with appropriate messages.
10 M

4 (a) Explain switch statement with an example.
6 M
4 (b) What is a loop? Explain the different loops in C language.
10 M
4 (c) Show how break and continue statements are used in a C program, with example.
4 M

5 (a) What is an array? How is a single dimension array is declared and initialized?
6 M
5 (b) Write a C program to evaluate the polynomial $f(x)-a_4x^4 + a_3x^3 + a_2x^2 + a_1x+a_0,$ for given value of x and its coefficients using Horner's merhod.
6 M
5 (c) Explain string manipulation functions, with examples.
8 M

6 (a) What is a functions? Write a function to find the sum of two numbers.
6 M
6 (b) Explain the two categories of argument passing techniques., with examples.
6 M
6 (c) Write a C function isprime(num) that acepts an integer argument and return 1 if the argument is a prime or a 0 otherwise. Write a program that invokes this function to generate prime numbers between the given ranges.
8 M

7 (a) What is structure data types? Explain.
4 M
7 (b) Show how a structure variable is passed as a parameter to a function, with an example.
6 M
7 (c) Explain the concept of array of structures with a suitable C program.
10 M

8 (a) What is a file? Explain fopen(), fclose() functions.
4 M
8 (b) Explain how the input is accepted from a file and displayed.
6 M
8 (c) Give two text documentary files "Ramayana" and "Mahabharatha-in". Write a C program to create a new file "Karnataka -in" that appends the content of the file "Ramayana-in" to the file "Mahabharatha-in". Also calculate the number of words and new lines in the output file.
10 M

9 (a) What is a pointer? Write a program in C to find the sum and mean of all elements in an array. Use pointer technology.
8 M
9 (b) What is preprocessor directive? Explain #define and #include preprocessor directives.
8 M
9 (c) Explain:
i) Dynamic memory allocation
ii) Malloc function
4 M

10 (a) What are primitive and non primitive datatypes? Explain.
6 M
10 (b) Define queue. Explain it along with its application.
8 M
10 (c) Explain:
i) Abstract data type
ii) Stack