Forwarded from IS AM 2022 (M .Al-mamari)
Forwarded from IS AM 2022 (M .Al-mamari)
What will be the output of the following C++ code?
#include<iostream>
using namespace std; int main () { int cin; cin >> cin; cout << "cin: " << cin; return 0; }
#include<iostream>
using namespace std; int main () { int cin; cin >> cin; cout << "cin: " << cin; return 0; }
Anonymous Quiz
13%
Segmentation fault
10%
Nothing is printed
45%
Error
32%
cin: garbage value
Forwarded from IS AM 2022 (M .Al-mamari)
What will be the output of the following C++ code?
#include <iostream>
using namespace std; int main() { char c = 74; cout << c; return 0; }
#include <iostream>
using namespace std; int main() { char c = 74; cout << c; return 0; }
Anonymous Quiz
20%
I
56%
J
8%
A
15%
N
What will be the output of the following C++ program?
#include <iomanip>
#include <iostream> using namespace std; int main() { cout << setprecision(17); double d = 0.1; cout << d << endl; return 0; }
#include <iomanip>
#include <iostream> using namespace std; int main() { cout << setprecision(17); double d = 0.1; cout << d << endl; return 0; }
Anonymous Poll
33%
copile time error
10%
0.10001
10%
0.11
47%
0.10000000000000001
Forwarded from IS AM 2022 (M .Al-mamari)
What will be the output of the following C++ code?
#include <iostream>
using namespace std; int main() { int a = 5; float b; cout << sizeof(++a + b); cout << a; return 0; }
#include <iostream>
using namespace std; int main() { int a = 5; float b; cout << sizeof(++a + b); cout << a; return 0; }
Anonymous Quiz
14%
2 5
43%
4 5
32%
4 6
10%
2 6
Forwarded from IS AM 2022 (M .Al-mamari)
What will be the output of the following C++ code?
#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
19%
14
68%
7
7%
6
Forwarded from IS AM 2022 (M .Al-mamari)
#include <stdio.h #include<iostream>
using namespace std; int main () {
int array[] = {0, 2, 4, 6, 7, 5, 3}; int n, result = 0; for (n = 0; n < 8; n++) }result += array[n]; } cout << result return0; }
using namespace std; int main () {
int array[] = {0, 2, 4, 6, 7, 5, 3}; int n, result = 0; for (n = 0; n < 8; n++) }result += array[n]; } cout << result return0; }
Anonymous Quiz
10%
21
76%
27
8%
26
6%
25
Forwarded from IS AM 2022 (M .Al-mamari)
What will be the output of the following program?
#include <iostream>
using namespace std; int main() { int num[4]={4,5,6,8}, sum = 0; for (int i = 0; i < 4; ++i) { sum += num[i]; } cout << "Sum = " << sum << endl; return 0؛
#include <iostream>
using namespace std; int main() { int num[4]={4,5,6,8}, sum = 0; for (int i = 0; i < 4; ++i) { sum += num[i]; } cout << "Sum = " << sum << endl; return 0؛
Anonymous Quiz
70%
23
15%
24
11%
25
4%
28
Forwarded from IS AM 2022 (M .Al-mamari)
What is the output of the following program?
#include<iostream>
#include<math.h> using namespace std; int main() { int num=10,num1=2,out; out = num*pow(num,num1); out = out % 2; out += 1; cout<<out; return 0; }
#include<iostream>
#include<math.h> using namespace std; int main() { int num=10,num1=2,out; out = num*pow(num,num1); out = out % 2; out += 1; cout<<out; return 0; }
Anonymous Quiz
16%
0
53%
1
18%
2
13%
01
Forwarded from IS AM 2022 (M .Al-mamari)
What is the output of the following program?
#include <iostream>
using namespace std; int main() { int n=365, reverse=0, rem; while(n!=0) { rem=n%10; reverse=reverse*10+rem; n/=10; } cout<<reverse<<endl; return 0; }
#include <iostream>
using namespace std; int main() { int n=365, reverse=0, rem; while(n!=0) { rem=n%10; reverse=reverse*10+rem; n/=10; } cout<<reverse<<endl; return 0; }
Anonymous Quiz
10%
573
32%
563
52%
Error
7%
All above
Forwarded from IS AM 2022 (M .Al-mamari)
What will be the output of the following program?
#include <iostream>
using namespace std; int main() { int a[] = {2,3,6,9}; cout << (1 + 1)[a] + (a + 2)[1]; }
#include <iostream>
using namespace std; int main() { int a[] = {2,3,6,9}; cout << (1 + 1)[a] + (a + 2)[1]; }
Anonymous Quiz
31%
15
28%
18
19%
12
21%
21
Forwarded from IS AM 2022 (M .Al-mamari)
What is the output of the following program?
#include<iostream>
using namespace std; int main() { int dec=6, bin[10], i=0; while(dec!=0) { bin[i] = dec%2; i++; dec = dec/2; } for(i=(i-1); i>=0; i--) cout<<bin[i]; return 0; }
#include<iostream>
using namespace std; int main() { int dec=6, bin[10], i=0; while(dec!=0) { bin[i] = dec%2; i++; dec = dec/2; } for(i=(i-1); i>=0; i--) cout<<bin[i]; return 0; }
Anonymous Quiz
41%
110
20%
111
26%
112
13%
101
Forwarded from IS AM 2022 (M .Al-mamari)
What is the output of the following program?
#include<iostream>
using namespace std; int main(){ int n = 128,a=0; int res = n/a; cout<<res; return 0; }
#include<iostream>
using namespace std; int main(){ int n = 128,a=0; int res = n/a; cout<<res; return 0; }
Anonymous Quiz
26%
128
6%
1
19%
0
50%
Error
Forwarded from المخزن | IT 22 (◔̯◔)
Forwarded from المخزن | IT 22 (◔̯◔)