0% found this document useful (0 votes)
55 views

CSC104 356 510-csc104

This document contains questions from a Computer Programming Using C exam for the second semester. It covers topics like pointers, arrays, structures, functions, files, and more. The exam has 4 parts with a total of 100 marks. Part A contains short answer questions. Part B asks to answer 4 out of 7 longer questions. Part C has 5 questions to choose from. Part D requires answering 1 of 2 final questions.

Uploaded by

Aniket Ambekar
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 views

CSC104 356 510-csc104

This document contains questions from a Computer Programming Using C exam for the second semester. It covers topics like pointers, arrays, structures, functions, files, and more. The exam has 4 parts with a total of 100 marks. Part A contains short answer questions. Part B asks to answer 4 out of 7 longer questions. Part C has 5 questions to choose from. Part D requires answering 1 of 2 final questions.

Uploaded by

Aniket Ambekar
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
You are on page 1/ 7

Dec-2015 CSC 104

USN 2 B V

I Semester B.E. Examination


(Common to All Branches)
Computer Programming Using C (CSC104)
Duration: 3 hours Max. Marks: 100

Note: i) Answer all questions from part-A, any four questions from part-B, any Five
questions from part-C; one from part D.
ii) Draw a neat diagram wherever necessary.
PART-A (Answer all Questions)
1 a. What is the difference between compiler and interpreter (01 mark)
b. Write the syntax of formatted output statement. (01 mark)
c. List different parameter passing methods. (01 mark)
d. List all the keywords present in switch statement. (01 mark)
e. Give the size of float a[20] in terms of bytes. (01 mark)
f. List the searching techniques. (01 mark)
g. List any four string handling functions. (01 mark)
h. Define pointer in C language. (01 mark)
i. What is the advantage of using structure? (01 mark)
j. Define file pointer. (01 mark)
2 a. Explain how pointers are initialized with an example. (02 marks)
b. Predict the output of the following code:
int i=3;
while(i<6)
{
printf(“%d\n”,i);
i++;
} (02 marks)
c. Explain structure data type with syntax and example. (02 marks)
d. Identify errors in the following code and correct them:
main()
{
char s1[10],s2[10]=”BVB”;
s1=”cet”;
printf(“%s\t”,s2);
printf(“%s\t”,s1);
} (02 marks)
e Predict the output of the following code:

void fun(int,int); void fun(int n1, int n2)


main( ) {
{ printf(“%d\n”,x*y);
int n=3,i; }
for(i=1;i<=10;i++)
fun(n,i);
}

(02 marks)
Page 1
PART-B (Answer any four questions)
3 Write a modular C program to find area of a triangle given three sides. (05 marks)
4 For the following function write appropriate test cases:
Void facto(int *n1,int *fact)
{
int i;
for(i=1;i<=*n1;i++)
*fact=*fact * i;
} (05 marks)
5 Observe the input and output given below:
input output
n=3 6 (1+2+3)
n=4 10 (1+2+3+4)
n=5 15 (1+2+3+4+5)
Write a modular c program to produce appropriate output for any value of n,
n>0. (05 marks)
6 Explain the following string handling functions:
i)strlen( ) ii)strcat( ) (05 marks)
7 A C function search( ) accepts three integer arguments(integer array,size of an
array, key element) and search the key element in an array. Write test cases for
function search( ). (05 marks)
PART-C (Answer any five questions)
8 a. Write a modular C program to read a number and check number is odd or
even. (05 marks)
b. Differentiate between RAM and ROM. (05 marks)
9 a. Write a modular C program to print the following pattern using appropriate
construct:
1
2 2
3 3 3
4 4 4 4
(05 marks)
b. Identify the valid and invalid variables in the list given below:
i)abcd123 ii)return iii)1abcd iv)xy*z v)intfloat (05 marks)
10 a. Explain the syntax and usage of do-while loop construct of C language and
give an example. (05 marks)
b. Write a C function strcmp (char S1[],char S2[])to compare two string S1 and
string S2 without using built in string handling function. (05 marks)
11 Write user defined functions for the following:
i)to read matrix of order m*n
ii)to transpose the matrix
iii) to display the matrix of order m*n
Write a suitable main() function to call the above user defined functions. (10 marks)
12 For the given code:
void read(int array[10][10],int r, int c);
void display(int array[10][10],int r,int c);
int sum(int a[10][10],int r,int c);

(10 marks)
Page 2
main() void read(int array[10][10],int r,int c)
{ {
int array[10][10],r,c; int i,j;
scanf(“%d%d”,&r,&c); for(i=0;i<r;i++)
read(array,r,c); for(j=0;j<c;j++)
display(array,r,c); scanf(“%d”,&array[i][j]);
sum(array,r,c); }
printf(“SUM=%d\n”,s); void display(int array[10][10],int r,int c)
} {
void sum(int a[10],int n) int i,j;
{ for(i=0;i<r;i++)
int i,j,s; {
for(i=0;i<r;i++) for(j=0;j<c;j++)
{ printf(“%d\t”,array[i][j]);
s=0; printf(“\n”);
for(j=0;j<c;j++) }
{ }
s=s+a[i][j];
}
printf(“%d\t%d\n”,i,s);
}
}

i)Identify the local variables.


ii) Identify the number of user
defined functions.
iii) List branching and looping
statements.
iv) Identify actual and formal
parameters.
v) Write the purpose of the given
program.
13 a. Explain how pointers are declared and initialized with example. (05 marks)
b. Predict the output for the following code:
main( )
{
float a=14.5,y=10.0,*p1,*p2;
float r1,r2,r3,r4;
p1=&x;
p2=&y;
r1= *p1+(--*p2);
printf(“r1=%f\n”,r1);
r2=x/(*p1);
printf(“r2=%f\n”,r2);
r3=((*p2)--)*(*p1);
printf(“r3=%f\n”,r3);
r4=y-(*p2);
printf(“r4=%f\n”,r4);
} (05 marks)

Page 3
PART-D (Answer any one Question)
14 a. Explain union data type with syntax and example, also list the advantages. (05 marks)
b. Write a modular C program to create a structure with the information given.
Emp[10].
i)Emp_id, ii) address, iii)salary, iv)designation, v)name.
Write a function to print all the employees having salary above Rs.20000. (05 marks)
15 a. Explain basic file handling functions. (05 marks)
b. Write a C program to count the number of characters and number of lines in a
file. (05 marks)

Page 4
Department: Sem:II Sub-Name: Computer programming Using C
Sub-Code: CSC104 Faculty Name:Priyadarshini D Kalwad
Q.No Course Learning Bloom’s Learning Levels a-k Criteria
Objectives(CLO’s) (LL)
1: a
b
c
d
e
f
g
h
i
j
2: a
b
c
d
e
3
4
5
6
7
8: a
b
9: a
b
10: a
b
11: a
b
12: a
b
13: a
b
14: a
b
15: a
b

Page 5
K.L.E Society’s
B.V.Bhomaraddi College of Engineering & Technology, Hubli-580 031

Examination Section
Semester End Examination Question Paper Review
Set I / Set II / Set III/ External
(Strike off the not Applicable one)
Programme: Course: Course Code:
Duration: Hrs Semester:
Self Review Expert
Criterion (Yes/No/NA/ Review
Number (Yes/No/NA/
Number
1] Whether the following details are mentioned correctly on YES
the
Header of the question paper (Exam month and year etc
up to instructions)?
2] Whether the question paper covers the entire syllabus YES
(unit wise) as announced in the scheme of SEE at the end
of prescribed syllabus for this course?
3] Whether the pattern of question paper is in accordance YES
with the model question paper?
4] Whether marks distribution is proper for all the questions YES
and sub questions?
5] Whether the question paper has all the required data and YES
figures? If figures exist, mention the number of figures in
the paper.
6] Mention the time required for an average student to 180 MNS
answer this paper (in minutes)
7] How many corrections you have made in the print copy of NIL
the question paper (typographical errors etc)?
8] Whether the scheme is ready along with the paper? YES
9] Whether the scheme contains marks splitting along with YES
points?
10] a) How many numerical problems are there in the
question paper?
b) How many worked out solutions exist in the scheme?
11] Is the Softcopy previewed for printing & verified for YES
corrections?
12] Would you like to do modifications to any of the NA *Yes/No
questions? (only for reviewer)
Reviewer’s Signature
Reviewer’s
Name
Date of Review

*If Yes please fill in the details on the reverse page

Page 6
To,
The Controller of Examinations
B.V.B College of Engineering & Technology, Hubli.

Sir,

After scrutinizing I Recommend No/ The Following (Strike out not applicable)
corrections for this paper. The details are as follows:

Department:__________________________ Course-
_____________________
Paper Code:___________________________ Course
Code:________________

Correction Unit Question & Existing Question Suggested Change Reasons for Change
No No Sub Questions

Date:______________ Signature of Scrutinizer


Scrutinizer:_____________
Name of the Scrutinizer:_

Page 7

You might also like