CSC104 356 510-csc104
CSC104 356 510-csc104
USN 2 B V
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:
(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);
}
}
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
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
Page 7