# Computer Programming 3rd Semester ME MG University November 2013

### Exam Categories

me
previous paper
s3
mg university
previous question paper
c theory
semester 3
computer programming
programming in c

MG University 3rd semester Btech question for Mechanical Engineering

B.TECH DEGREE EXAMINATION, November 2013

Third Semester

BRANCH: MECHANICAL ENGINEERING

AU 010 305

ME 010 305 - COMPUTER PROGRAMMING (AU, ME, PE and MT)

PE 010 305

MT 010 305

(New Scheme-Regular/Improvement/Supplementary)

Time : Three Hours Maximum:100 Marks

Part A

Each Question Carries 3 marks

1. List the various data types in C, giving example for each?

2. Write appropriate type declarations to create the following.

i)An array to record the weights of 60 students in a class

ii)A two dimensional array to classify students by sex and one of five occupations that the students intend to take up after the completion of their studies

iii)A three dimensional array to classify the students by age(15 years to 25 years), years of study(10 to 15 years) and one of 10 major subjects of study.

3. What are the two main components of a function definition? Illustrate with an example

4.What happens when a pointer to a structure is incremented?

5. What are the 2 methods to update a data file? Which is better?

Part B

Each Question carries 5 marks

6. Explain if, if-else and switch statements with suitable examples

7. Explain union with an example and state the uses of union?

8. What is recursion? Explain with an example program?

9. What is linked list? Describe its functions, merits and demerits

10. Describe two bitwise shift operators? What requirement must the operators satisfy? What is the purpose of each operand?

Part C

Each question carries 12 marks

11. a)Describe with the help of examples, all the operators in C, specifying the hierarchy of operations.

b)What is an escape sequence?Give an example and explain the purpose of the same.

or

12. Write a C program to compute x- x3/3! + x5/5! - x7/7! +..., up to 5 decimal place correction.

13. Write a C program to search an element from a list of sorted integers using binary search method.

or

14. Write a program to print the upper and lower triangles of a matrix

15. Write a function to accept 10 characters and to display whether each input character is a digit, a lower case or uppercase alphabet or a special symbol character? Write the main program to call it?

or

16. Write a program to input 100 students details as structure and display them. Structure fields( Register number, branch, semester, mark1, mark2.... mark 8, total)

17. Write a function, using pointers to add two matrices and to return the resultant matrix to the calling function

or

18. Write a C program to create a single linked list to read a set of N numbers and to print the list in ascending order

19. Associate a stream pointer point with a new stream oriented data file called sample.dat Open the data file so that information can either be read from or written in to the file. Show how the data file can be closed at the end of the program

or

20.Write a C program that will receive a file name and a line of text as command line argument and write the text to the file.

computer-programming-3rd-semester-me-mg-university-november-2013