Programming and Problem Solving
CSE · Quiz · Fall 26
Paper 9 of 9Section 72_B · Batch 72Switch
Section 72_B · Batch 72
Paper 9 of 9
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Department of Computer Science and Engineering
Faculty of Science and Information Technology
Daffodil International University
Class Test No.: 3
Semester: Fall 2026
Course Code: CSE113
Course Title: Programming and Problem Solving
Total Marks: 15
Duration: 20 Minutes
Student ID: ....................................... Section: 72_B Date: .......................................
1. Write the output of the following program. 2
void main()
{
int a[2][3] = {{1, 2, 3}, {4, 5, 6}};
int i, j;
for(i = 0; i < 2; i++)
{
for(j = 0; j < 3; j++)
{
printf("%d ", a[i][j]);
}
printf("\n");
}
}
OUTPUT:
2. Write the output of the following program. 2
void main()
{
char str[] = "DIU";
printf("%s\n", str);
printf("%c\n", str[1]);
}
OUTPUT:
3. Write the output of the following program. 2
void main()
{
int x = 10;
int *p;
p = &x;
*p = *p + 5;
printf("Value of x = %d\n", x);
printf("Value of *p = %d\n", *p);
}
OUTPUT:
4. Consider the following declaration and choose the correct statement. 2
char str[6] = "Hello";
A. The array stores 5 characters, and no null character is required.
B. The array stores 6 characters, including the null character '\0'.
C. The array stores 6 visible characters and automatically adds another null character.
D. The array is invalid because its size must be 5.
Department of Computer Science and Engineering
Faculty of Science and Information Technology
Daffodil International University
5. Write the output of the following program. 3
void main()
{
int a[2][3] = {{2, 4, 6}, {1, 3, 5}};
int i, j, sum = 0;
for(i = 0; i < 2; i++)
{
for(j = 0; j < 3; j++)
{
if(a[i][j] % 2 == 0)
sum = sum + a[i][j];
}
}
printf("Sum = %d\n", sum);
}
OUTPUT:
6. Write a C program to concatenate two strings manually without using the strcat() library function. Display the concatenated string as output. 4
Sample Input:
Enter first string: Byte
Enter second string: Bridge
Sample Output:
Concatenated string: ByteBridge
Write your program here: