SRI KALISWARI COLLEGE (AUTONOMOUS), SIVAKASI
DEPARTMENT OF COMPUTER APPLICATIONS
ACADEMIC YEAR 2022 – 2023 (ODD SEMESTER)
TALENT SHOW – 2022
TECH ZONE
Software Debugging Prelims
Rules
1. Need to answer all the questions.
2. No negative marks.
3. Judge decision will be final.
Answer all the questions
Name : [Link] :
Date : 06.08.2022 Duration: 15 Minutes
1) What will be the output of the following code snippet?
#include <stdio.h>
int main() {
int a = 3, b = 5;
int t = a;
a = b;
b = t;
printf("%d %d", a, b);
return 0;
}
a) 3 5 b) 3 3 c) 5 5 d) 5 3
2) How is an array initialized in C language?
a) int a[3] = {1,2,3}; b) int a = {1,2,3};
c) int a[] = new int[3]; d) int a(3) = [1,2,3];
3) How the 3rd element in an array accessed is based on pointer notation?
a) *a + 3 b) *(a + 3) c) *(*a+3) d) &(a + 3)
4) How are String represented in memory in C?
a) An array of characters b) The object of some class
c) Same as other primitive type d) Linked list of characters
5) What does the following declaration indicate?
int x: 8;
1
a) X stores a value of 8 b) x is an 8-bit integer
c) Both a and b d) None of the above
6) Which of the following user-defined header file extension used in C++?
a) hg b) cpp c) h d) hf
7) What will be the output of the following C++ code?
#include <iostream.h>
#include <string.h>
int main(int argc, char const *argv[])
{
char s1[6] = "Hello";
char s2[6] = "World";
char s3[12] = s1 + " " + s2;
cout<<s3;
return 0;
}
a) Hello b) World c) Error d) Hello World
8) Which of the following type is provided by C++ but not C?
a) double b) float c) int d) bool
9) Which is more effective while calling the C++ functions?
a) Call by Object b) Call by Pointer
c) Call by Value d) Call by Reference
10) Which of the following is used to terminate the function declaration in C++?
a) ; b) ] c) ) d) :
*********************************** All the Best ****************************************