Which of the following correctly declares an array in C++?
Anonymous Quiz
2%
array{10};
4%
int array;
5%
array array[10];
89%
int array[10];
❤2
Which is more effective while calling the C++ functions?
Anonymous Quiz
8%
call by object
11%
call by pointer
68%
call by reference
14%
call by value
❤2
Which of the following is used to terminate the function prototype in C++?
Anonymous Quiz
3%
:
4%
]
71%
;
22%
)
❤2👍1
What will be the output of the following C++ program?
#include <iostream>
using namespace std;
int main(){
for(int i=1;i<=5 ;i++ ){
if(i==3){
continue;
}
cout << i << " ";
}
return 0;
}
🤔3👍2
What will be the output of the following C++ program?
#include <iostream>
using namespace std; int main(){ for(int i=1;i<=5 ;i++ ){ if(i==3){ continue; } cout << i << " "; } return 0; }
#include <iostream>
using namespace std; int main(){ for(int i=1;i<=5 ;i++ ){ if(i==3){ continue; } cout << i << " "; } return 0; }
Anonymous Quiz
12%
12345
5%
1234
79%
1245
3%
1235
❤2👍1
What will be the output of the following C++ program?
#include <iostream>
using namespace std;
void fun(int x,int y){
x=20;
y=10;
}
int main(){
int x=10;
fun(x,x);
cout << x << endl;
return 0;
}
What will be the output of the following C++ program?
#include <iostream>
using namespace std; void fun(int x,int y){ x=20; y=10; } int main(){ int x=10; fun(x,x); cout << x << endl; return 0; }
#include <iostream>
using namespace std; void fun(int x,int y){ x=20; y=10; } int main(){ int x=10; fun(x,x); cout << x << endl; return 0; }
Anonymous Quiz
14%
20
70%
10
5%
30
10%
Error
👍3❤2
What will be the output of the following C++ code?
#include <iostream>
using namespace std; int main() { char c = 73; cout << c; return 0; }
#include <iostream>
using namespace std; int main() { char c = 73; cout << c; return 0; }
Anonymous Quiz
23%
J
17%
A
48%
I
11%
N
👎3❤2👍1
What is the correct definition of an array?
Anonymous Quiz
5%
An array is a series of element.
70%
An array is a series of elements of the same type in contiguous memory locations.
19%
An array is a series of elements of the same type placed in non-contiguous memory locations.
6%
An array is an element of the different type.
❤1
What will be the output of the following C++ program?
#include<iostream>
using namespace std; int main(){ int x = 5; auto a = x; x++; cout<<"Value of a: "<<a<<endl; return 0; }
#include<iostream>
using namespace std; int main(){ int x = 5; auto a = x; x++; cout<<"Value of a: "<<a<<endl; return 0; }
Anonymous Quiz
4%
Segmentation fault
56%
Value of a: 5
9%
Error
31%
Value of a: 6
❤1👍1😢1
What will be the output of the following C++ program?
#include <iostream>
using namespace std; int main (){ int a, b, c; a = 2; b = 7; c = (a > b) ? a : b; cout << c; return 0; }
#include <iostream>
using namespace std; int main (){ int a, b, c; a = 2; b = 7; c = (a > b) ? a : b; cout << c; return 0; }
Anonymous Quiz
7%
12
15%
14
9%
6
69%
7
👍3❤2
23 What will be output of the following program?
#include<iostream>
using namespace std; int main (){ int array[] = {0, 2, 4, 6, 7, 5, 3}; int x, result = 0; for (int i = 0; i < 8; i++) result += array[x]; cout << result; return 0; }
#include<iostream>
using namespace std; int main (){ int array[] = {0, 2, 4, 6, 7, 5, 3}; int x, result = 0; for (int i = 0; i < 8; i++) result += array[x]; cout << result; return 0; }
Anonymous Quiz
3%
25
38%
27
7%
26
52%
Compile time error
👍3🫡3
What will be the output of the following C++ program?
int i; enum month { JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC }; for (i = MAR; i <= NOV; i++) cout << i;
int i; enum month { JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC }; for (i = MAR; i <= NOV; i++) cout << i;
Anonymous Quiz
10%
01234567891011
17%
123456789101112
66%
34567891011
6%
123456789
❤3
What will be the output of the following C++ program?
#include <iostream>
using namespace std; enum test { A = 32, B, C }; int main() { cout << A << B<< C; return 0; }
#include <iostream>
using namespace std; enum test { A = 32, B, C }; int main() { cout << A << B<< C; return 0; }
Anonymous Quiz
13%
323232
5%
323130
5%
323134
77%
323334
❤2
What is the index number of the last element of an array with 9 elements?
Anonymous Quiz
8%
9
77%
8
7%
0
9%
Programmer-defined
❤2
What will be the output of the following C++ program?
#include <iostream>
using namespace std; enum cat { temp = 7 }; int main() { int age = 14; age /= temp; cout << "If you were cat, you would be " << age << endl; return 0; }
#include <iostream>
using namespace std; enum cat { temp = 7 }; int main() { int age = 14; age /= temp; cout << "If you were cat, you would be " << age << endl; return 0; }
Anonymous Quiz
3%
If you were cat, you would be 5
74%
If you were cat, you would be 2
5%
If you were cat, you would be 9
18%
If you were cat, you would be 7
❤2
Which of the following accesses the seventh element stored in array?
Anonymous Quiz
3%
array;
3%
array(7);
37%
array[7];
56%
array[6];
👎5👍3❤2
What will be the output of the following C++ program?
#include<iostream>
using namespace std; int fun(int x = 0, int y = 0, int z) { return (x + y + z); } int main() { cout << fun(10); return 0; }
#include<iostream>
using namespace std; int fun(int x = 0, int y = 0, int z) { return (x + y + z); } int main() { cout << fun(10); return 0; }
Anonymous Quiz
34%
10
8%
0
10%
Segmentation fault
48%
Error
👍5👎3
Which is more effective while calling the functions?
Anonymous Quiz
4%
call by object
5%
call by pointer
83%
call by reference
8%
Call by value
❤2
What will be the output of the following C++ program?
#include <stdio.h>
#include <iostream> using namespace std; int main() { int array[] = {10, 20, 30}; cout << -2[array]; return 0; }
#include <stdio.h>
#include <iostream> using namespace std; int main() { int array[] = {10, 20, 30}; cout << -2[array]; return 0; }
Anonymous Quiz
3%
-15
35%
-30
46%
compile time error
15%
garbage value
👍3❤2
❤2