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
6%
12
18%
14
8%
6
68%
7
❤1
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
2%
25
40%
27
6%
26
52%
Compile time error
👍2
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
12%
01234567891011
14%
123456789101112
69%
34567891011
5%
123456789
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
18%
323232
7%
323130
6%
323134
69%
323334
What is the index number of the last element of an array with 9 elements?
Anonymous Quiz
8%
9
80%
8
4%
0
8%
Programmer-defined
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
4%
If you were cat, you would be 5
73%
If you were cat, you would be 2
6%
If you were cat, you would be 9
17%
If you were cat, you would be 7
Which of the following accesses the seventh element stored in array?
Anonymous Quiz
6%
array;
6%
array(7);
36%
array[7];
52%
array[6];
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
33%
10
7%
0
8%
Segmentation fault
52%
Error
🫡2
Which is more effective while calling the functions?
Anonymous Quiz
8%
call by object
6%
call by pointer
80%
call by reference
6%
Call by value
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
2%
-15
39%
-30
46%
compile time error
12%
garbage value
🤔2👍1
What will be the output of the following C++ program?
#include <stdio.h>
#include<iostream>
using namespace std;
int array1[] = {1200, 200, 2300, 1230, 1543};
int array2[] = {12, 14, 16, 18, 20};
int temp, result = 0;
int main()
{
for (temp = 0; temp < 5; temp++)
{
result += array1[temp];
}
for (temp = 0; temp < 4; temp++)
{
result += array2[temp];
}
cout << result;
return 0;
}
علم البيانات | DS2 Quizes
What will be the output of the following C++ program? #include <stdio.h> #include<iostream> using namespace std; int array1[] = {1200, 200, 2300, 1230, 1543}; int array2[] = {12, 14, 16, 18, 20}; int temp, result = 0; int main() { for (temp…
What will be the output of the following C++ program?
Anonymous Quiz
2%
6522
24%
12200
42%
6533
32%
6553
What is the scope of the variable declared in the user defined function?
Anonymous Quiz
5%
whole program
17%
the main function
17%
header section
61%
only inside the {} block
👍2🤔1
Which of the following is important in a function?
Anonymous Quiz
11%
Function name
6%
Return type
35%
Both return type and function name
49%
The return type, function name and parameter list
What will be the output of the following C++ program?
#include <iostream>
using namespace std; int fun(int=0, int = 0); int main() { cout << fun(5); return 0; } int fun(int x, int y) { return (x+y); }
#include <iostream>
using namespace std; int fun(int=0, int = 0); int main() { cout << fun(5); return 0; } int fun(int x, int y) { return (x+y); }
Anonymous Quiz
2%
-5
62%
5
22%
0
14%
10
What's the output of the following code?
#include <iostream>
using namespace std; int main(int argc, char *argv[]) { char s0[4]={'D','r','.'}; char s1[5]="Musa"; char s2[7]={"Ghorab"}; cout << s0 << " " << s1 << " " << s2 << "\n"; return 0; }
#include <iostream>
using namespace std; int main(int argc, char *argv[]) { char s0[4]={'D','r','.'}; char s1[5]="Musa"; char s2[7]={"Ghorab"}; cout << s0 << " " << s1 << " " << s2 << "\n"; return 0; }
Anonymous Quiz
7%
Ghorab
10%
Musa
80%
Dr. Musa Ghorab
3%
Dr.
كل هذه الأسئلة من نماذج سابقة للدكتور #موسى_غراب
❤1
What is the primary goal of Data Science?
Anonymous Quiz
34%
Data Visualization
18%
Data Cleaning
32%
Predictive Analytics
16%
Extracting Data from APIs
Which programming language is commonly used for Data Science tasks?
Anonymous Quiz
13%
Java
53%
Python
33%
C++
3%
JavaScript