Computer Programming 2018 Question Paper — Government College of Engi…
The 2018 Computer Programming previous year question paper (Government College of Engineering and Technology, Jammu), with every question and its marks.
- University: Government College of Engineering and Technology, Jammu
- Subject: Computer Programming
- Course: Computer Programming
- Branch: BE-II/6(A)
- Year: 2018
- Paper: end-term
- Duration: 180 minutes
- Total marks: 100
Instructions
- Attempt any five questions selecting at least two questions from each section.
Questions
SECTION - A
- Q1. (a) What is the structured programming? Explain the relevant constructs using pseudo code. Highlight the advantages and disadvantages of structured programming. (10) (b) What is an algorithm and flowchart? Develop an algorithm and flowchart to test whether a given number is prime. (10) [20 marks]
- Q2. (a) Explain the two ways selection - if, if - else, nested - if, cascaded if - else in C language with suitable example. (10) (b) Explain switch statement with syntax with suitable example. (5) (c) Design and develop C program to read a year as input and find whether it is leap year or not? (5) [20 marks]
- Q3. (a) Write the syntax of for loop. Describe the difference between the for and while loop with suitable example. (10) (b) Using "switch" statement, write a program to simulate a simple calculator which is used to carry basic operations like addition, subtraction, multiplication and division. The input will be given in infix form. i.e. operand1 operator operand2. (eg: 4+5, 10-4, 12*4, 3/5). (10) [20 marks]
- Q4. (a) Explain any five string manipulation library functions with suitable example. (12) (b) Write a program to illustrate the concept of extern variable and static variable. (8) [20 marks]
SECTION - B
- Q5. (a) What is an array? Explain the declaration and initialization of one and two dimensional arrays with example. (8) (b) Write a function that can be called to compute the product of two matrices of size m by n and n by m. The main () function provides the values for m and n and two matrices. (12) [20 marks]
- Q6. (a) Explain call by value and call by reference with suitable example. (10) (b) What is structure? Explain the syntax of structure declaration. Illustrate the concept of structure by writing a program to read the following information of 60 students: students Name, students Roll No. and marks in two subjects. Print the roll no. that has scored more than 60% marks. (10) [20 marks]
- Q7. (a) What are pointers? Why are they needed? Write a program to add two numbers using pointers. (7) (b) Discuss dangling pointer with suitable example. (6) (c) Write short note on dynamic memory allocation. (7) [20 marks]
- Q8. (a) Explain the different input output operations of files. (10) (b) Write a C program to read and display a text from file. (10) [20 marks]
Related pages
Other years
- Computer Programming 2022 question paper — end-term
- Computer Programming 2022 question paper — end-term
- Computer Programming 2022 question paper — end-term
- Computer Programming 2018 question paper — end-term
- Computer Programming 2018 question paper — end-term
- Computer Programming 2018 question paper — end-term
- Computer Programming 2018 question paper — end-term
- Computer Programming 2018 question paper — end-term
- Computer Programming 2018 question paper — end-term