PreExam 08 07 2023 D
PreExam 08 07 2023 D
1
9. What is printed to the console? 13. What is printed to the console?
(a) 101
(b) 10
(c) 500
(d) None of them
(a) 2 2 6 14
(b) 14 12 12 8
(c) 8 12 12 14
10. What is printed to the console?
(d) None of them
2
17. Most popular general-purpose programming 22. What will be the output of the following C++
languages (PL) today, such as C, C++ or Java code?
belong to:
#include <iostream>
(a) The first generation PL using namespace std;
void square (int &x, int &y) {
(b) The second generation PL x = x * --y;
}
(c) The third generation PL
int main () {
(d) The fourth generation PL int number = 30;
square(number, number);
cout << number;
18. Which of the given statements are false? return 0;
i. extern int func;
}
ii. extern int func2(int,int);
iii. int func2(int,int); (a) Compiler error!
iv. extern class foo;
(b) 30
(a) iii and iv only
(c) 870
(b) ii and iii only
(d) Run time error
(c) only iv
(d) ii, iii and iv
23. What is printed to the console?
19. What is the return values of sizeof(char) and
sizeof(int)?
(a) 1 and 4
(b) 1 and 2
(c) 1 and 8
(d) Non of them
3
26. What is the right statement concerning the In- 29. What will be the output of the following C++
ternet of Things networks? code?
(a) Numerous devices, wireless communi- #include <stdio.h>
cations and sharing/exchanging data #include<iostream>
using namespace std;
(b) Network topology is normally stable, int array1[] = {1200, 200, 2300, 1230, 1543};
communications are based on TCP/IP int array2[] = {12, 14, 16, 18, 20};
int temp, result = 0;
architecture int main(){
for (temp = 0; temp < 5; temp++) {
(c) All are correct result += array1[temp];
}
(d) All are wrong for (temp = 0; temp < 4; temp++){
result += array2[temp];
}
cout << result;
return 0;
}
(a) 6553
(b) 6522
(c) 6533
(d) 12200
27. What are the values of n1 and n2 after the
swap() function is called?
28. The most important attribute of a systems an- 32. What is the return values of sizeof(float) and
alyst is sizeof(double)
(a) excellent programming skills (a) 1 and 8
(b) very good hardware designing skills (b) 2 and 8
(c) very good technical management skills (c) 4 and 8
(d) very good writing skills (d) Non of them
4
33. Some critical issues in the Internet of Things 37. What is printed to the console?
network are:
(a) The energy sources for a huge number
of connected devices
(b) There are many wireless standards and
none of them is the best for many kinds
of IoTs applications
(c) The network topology is normally
changed due to mobility devices
(d) All of above
(a) 1234
(b) 1324
34. What is printed to the console? (c) 124
(d) None of them
35. Which of the following is important in a func- 39. What is printed to the console?
tion?
(a) Return type
(b) Function name
(c) Both return type and function name
(d) The return type, function name and
parameter list
5
40. Which of the following is a correct identifier in 42. Which instruction is executed by C/C++ Pre-
C++? processor?
(a) 7var_name (a) #include<iostream>
(b) 7VARNAME (b) return 0
(c) VAR_1234 (c) void main(int argc , char ** argv)
(d) $var_name (d) None of above
41. What are the values of all elements in the array
after this program? 43. Which of the following is used for comments in
C++?
(a) // comment
(b) /* comment */
(c) both // comment or /* comment */
(d) // comment */
END.
Dean of Faculty/Department Lecturer
6
Answer 1911
I. Choose the correct answer of each question.