0% found this document useful (0 votes)
55 views4 pages

Computer Programming Exam Paper 2019

This document is a question paper for the B.E. / B.Tech. degree examination in Computer Programming, conducted in November/December 2019. It consists of two parts: Part A includes 10 short answer questions worth 2 marks each, while Part B contains 5 detailed questions worth 16 marks each. The questions cover various topics related to C programming, including variable declaration, functions, memory allocation, and file handling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views4 pages

Computer Programming Exam Paper 2019

This document is a question paper for the B.E. / B.Tech. degree examination in Computer Programming, conducted in November/December 2019. It consists of two parts: Part A includes 10 short answer questions worth 2 marks each, while Part B contains 5 detailed questions worth 16 marks each. The questions cover various topics related to C programming, including variable declaration, functions, memory allocation, and file handling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Reg.

No

Question Paper Code : 16114

B.E. / [Link]. DEGREE EXAMINATION, NOVEMBER / DECEMBER 2019


First Semester
Common to all UG Programmes
19GE101 – COMPUTER PROGRAMMING
(Regulations: Mepco – R2019)

Duration: 3 Hours Max. : 100 Marks


Answer ALL Questions
BTL,CO
PART A – (10  2 = 20 Marks)

U,CO1 1. How to declare a variable? Give an example.


A,CO1 2. Which of the following is not a valid declaration in C?
1. short int x;
2. signed short x;
3. short x;
4. unsigned short x;
A) 3 and 4 B) 2 C) 1 D) All are valid
Justify your answer.
A,CO2 3. What is the output for the following C code?
#include <stdio.h>
int main()
{
int i, j=3;
float k=7;
i = k % j;
printf(“%d”, i);
return 0;
}
A) No output B) Compile Time Error
C) Abnormal Termination D) 1
Justify your answer.
A,CO2 4. The value of j at the end of the execution of the following C program is
__________.
int incr(int i)
{
static int count = 0;

1
16114
count = count + i;
return (count);
}
void main()
{
int i,j;
for (i = 0; i <=4; i++)
j = incr(i);
}
A) 10 B) 4 C) 6 D) 7
Justify your answer.
R,CO3 5. What is a null character? What is its use in a string?
A,CO3 6. Predict the output of following program:
int main()
{
int i;
int arr[5] = {1};
for (i = 0; i < 5; i++)
printf("%d ", arr[i]);
return 0;
}
A) 1 followed by four garbage values B) 1 0 0 0 0
C) 1 1 1 1 1 D) 0 0 0 0 0
Justify your answer.
A,CO4 7. What does the following fragment of C-program print?
char c[] = "GATE2011";
char *p = c;
printf("%s", p + p[3] - p[1]) ;
A) GATE2011 B) E2011 C) 2011 D) 011
Justify your answer.
R,CO4 8. Define void pointer with an example.
R,CO5 9. Write the syntax to declare the array of structure.
R,CO5 10. List out four functions that are used to read and write files.

PART B – (5  16 = 80 Marks)
U,CO1 11. a) i. Discuss in detail about the structure of a C program with an
example. (8 Marks)

2
16114
A,CO1 11. a) ii. Write an algorithm to print the Fibonacci Series up to „n‟
terms. (8 Marks)
OR
U,CO1 11. b) i. State the need for designing the steps to solve a problem.
Identify the flowchart symbols and state their purpose. (8 Marks)
A,CO1 11. b) ii. Write a pseudo code to count the number of positive
numbers, negative numbers and zeroes in a group of „n‟
numbers provided by the user. (8 Marks)

U,CO2 12. a) i. Explain in detail about the different classification of


functions based on arguments and return values with
suitable examples. (8 Marks)
A,CO2 12. a) ii. Write a C program to calculate Electricity Charges for the
following slab rate using branching statements:

[Link]. Units Rate per unit


1 0 - 100 Nil
2 101 - 500 2
3 501 - 1000 5
4 > 1000 10
(Hint: Electricity Charges = Units * Rate per unit) (8 Marks)
OR
U,CO2 12. b) i. Explain about the different kinds of storage classes with an
example. (8 Marks)
A,CO2 12. b) ii. Write a C program to find the sum of digits of the given
number using function. (8 Marks)

U,CO3 13. a) i. Describe in detail about any four character functions in


<ctype.h> with suitable example. (8 Marks)
A,CO3 13. a) ii. Write a C program to read the elements of a matrix of order
m × n and find the transpose of the matrix. (8 Marks)
OR
U,CO3 13. b) i. Describe in detail about passing one dimensional array as a
parameter in the function with an example program. (8 Marks)
A,CO3 13. b) ii. Write a menu driven program to perform the following:
A) Reverse of the String
B) Count the number of alphabets, numerals and other
special characters in the String
C) Exit (8 Marks)

3
16114
U,CO4 14. a) i. Explain dynamic memory allocation and describe the
library functions used for dynamic memory allocation with
proper examples. (8 Marks)
A,CO4 14. a) ii. Write a C program to search a string among a list of strings.
Dynamically allocate memory for the number of strings to
be stored. (8 Marks)
OR
U,CO4 14. b) i. Discuss in detail about command line arguments with an
example. (8 Marks)
A,CO4 14. b) ii. Write a C program to find the sum of „n‟ elements entered
by the user. Allocate memory for storing the elements based
on the user‟s input. (8 Marks)

U,CO5 15. a) i. Explain briefly with an example, the functions to be used to


access the files of records randomly. (8 Marks)
A,CO5 15. a) ii. Write a C program to keep records and perform statistical
analysis for a class of 20 students. The information of each
student contains ID, Name, quizzes Scores (2 quizzes),
mid-sem score, end-sem score, total score(to be calculated)
and average score (to be calculated). Assign grade for each
student as given below:

Average Score Grade


91-100 A+
81-90 A
71-80 B+
61-70 B
50-60 C
<50 RA (8 Marks)
OR
U,CO5 15. b) i. Compare Union and Structures. Explain how memory space
is allotted for Union and Structures with an example. (8 Marks)
A,CO5 15. b) ii. Write a C program to store the details of faculty (faculty id,
name, dept, designation, qualification) using a binary file.
Also, read the binary file and display the details of a faculty
belonging to a particular dept. (8 Marks)

4
16114

You might also like