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

up4

Uploaded by

arahimratul2004
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)
5 views

up4

Uploaded by

arahimratul2004
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/ 4

KHWAJA YUNUS ALI UNIVERSITY

School of Science and Engineering


Department of Computer Science and Engineering
Summer-2023 Final Examination
Program: B.Sc. in CSE (Batch 16th) 1st Year 1st Semester
Course Title: Structure Programming Language
Course Code: CSE 0613 1201
PART-A: MCQ
Time: 10 Minutes Total Marks: 10x01=10

Student’s ID:

Date:

(These are single best type of questions. Each of the following questions or statements has five suggested
answers or completions. Put tick mark (
) on the best answer. There is no counter marking.)

Domain: Cognitive Apply


1. As we know 32 bits machine stores 4 bytes for every single integer declaration. Calculate and mark the
size of the following structure.
struct temp {
int a[10];
char p; };
A) 44
B) 41
C) 36
D) 32
E) 8
Domain: Cognitive Understand
2. Which of the following statement will correctly store the concatenation of strings s1 and s2 in string s3?
A) s3 = strcat (s1, s2);
B) strcat (s1, s2, s3);
C) strcat (s3, s2, s1);
D) strcpy (strcat (s1, s2), s3);
E) strcpy (s3, strcat (s1, s2));
Domain: Cognitive Understand
3. What will be the value of table [1][1] considering the following declaration?
int table[2][3] = { 1,2,3,4,5};
A) 0
B) 2
C) 3
D) 5
E) Null
Domain: Cognitive Apply
4. What will be the output of the following program?
int a[] = {1,2,3,4,5}, *p;
p = a;
p += 2;
printf("%d ", *p);
A) 3
B) 2
C) 1
D) 0
E) Null
Domain: Cognitive Knowledge
5. What is the name of the function that calls itself?
A) self
B) dynamic
C) recursive
D) structure
E) static
Domain: Cognitive Analysis
6. What will be the output of the following program?
int i = -1;
do {
printf("C");
} while(i++);
A) C
B) CC
C) CCC
D) CCCC
E) C in Infinity times
Domain: Cognitive Evaluate
7. How many times the printf statement will be executed?
while(!!7)
printf("C");
A) 0
B) 1
C) 6
D) 7
E) Infinity
Domain: Cognitive knowledge
08 How do you find the length of a string in C?
. A) string.length();
B) length(string);
C) size(string);
D) strlen(string);
E) length.string();
Domain: Cognitive Knowledge
9. How do you declare a two-dimensional array named matrix with 4 columns and 3 rows?
A) int matrix[3][4];
B) int matrix[4][3];
C) int matrix[12];
D) matrix[3][4] = int;
E) matrix[4][3] = int;
Domain: Cognitive Evaluate
10 What will be the output after executing the following statements?
. int sum =0;
for(int i=-3;i<3;i++)
if(i)
sum+=i;
A) 0
B) -2
C) -3
D) -4
E) -6

Signature of Examiner
KHWAJA YUNUS ALI UNIVERSITY
School of Science and Engineering
Department of Computer Science and Engineering
Summer-2023 Final Examination
Program: B.Sc. in CSE (Batch 16th) 1st Year 1st Semester
Course Title: Structure Programming Language
Course Code: CSE 0613 1201

PART-B: SAQ
Time: 1 Hour and 50 Minutes Total Marks: 5x6=30
INSTRUCTIONS: Answer question no. 01 (one) and any 04 (Four) from the rest. Marks are shown by side.

Question No. Marks

1. Describe the purpose of "break" and "continue" statements in a loop. [02]

Write a program to calculate the sum and average of a set of N numbers by using array. [04]

2. Explain the difference between an array and a variable in C. [02]

Describe any two of the followings string handling functions: [04]


I. strcmp( )
II. strcpy( )
III. strlrn( )
IV. strcat( )

3. a What happens if an output data item contains more characters than the specified field width? [02]
)
b Which of the following initialization statements are correct? [04]
I. char str1[4] = “GOOD”;
)
II. char str3[5] = “Moon”;
III. char str4[ ] = {„S‟, „U‟, „N‟};
IV. char str5[10] = “Sun”;

4. a Compare and contrast a struct with a union in C. [02]


)
b Identify the correct statements for declaring one-dimensional array of structures of type struct [04]
item_bank considering the following declaration.
)
struct item_bank
{
int number;
double cost;
};

I. int item_bank items[10];


II. struct items[10] item_bank;
III. struct item_bank items (10);
IV. struct item_bank items [10];
5. a Define pointer in C. How do you declare a pointer variable in C? [03]
)
b Write down the value of each of the following expressions. Considering the declaration [03]
) int x = 10, y = 10;
int *p1 = &x, *p2 = &y;

I. (*p1) ++
II. *p1 + (*p2) – –
III. + + (*p2) – *p1

6. a Explain the types of user define function. [03]


)
b Determine the output of the following program. [03]
)
int prod( int m, int n);
int main ( )
{
int x = 10;
int y = 20;
int p, q;
p = prod (x,y);
q = prod (p, prod (x,z));
printf (“%d %d\n”, p,q);
return 0;
}

int prod( int a, int b)


{
return (a * b);
}

You might also like