Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q3) The while loop evaluates its condition before executing the code inside the loop.
Anonymous Quiz
66%
True
34%
False
👍1
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q4) The switch statement can only work with integer and character data types in C++.
Anonymous Quiz
77%
True
23%
False
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q5) In a do-while loop, the condition is evaluated after executing the loop's body.
Anonymous Quiz
74%
True
26%
False
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q7) Which header file is required for cin and cout?
Anonymous Quiz
2%
<stdlib.h>
3%
<conio.h>
0%
<stdio.h>
95%
<iostream>
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q8) C++ is a _ type of language.
Anonymous Quiz
5%
low-level language.
84%
high-level language.
10%
middle-level language.
1%
None of the above.
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q9) What is the output of the following loop?
int i = 0;
while (i < 5) { cout << i <<" ";}
int i = 0;
while (i < 5) { cout << i <<" ";}
Anonymous Quiz
13%
0 1 2 3 4 5
8%
1 2 3 4 5
38%
0 1 2 3 4
40%
Infinite loop.
👍2
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q9) What will be the output of the following code?
#include <iostream>
using namespace std; int main(){ /* this is comment cout <<"hello world"; return 0;}
#include <iostream>
using namespace std; int main(){ /* this is comment cout <<"hello world"; return 0;}
Anonymous Quiz
24%
hello world
0%
hello
76%
error
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q13) What is the value of p in the following C++ code?
#include<iostream>
using namespace std; int main() { int p; bool a=true; bool b=false; int x=10; int y=5; p= ((x+y*2)+(a+b)) ; cout<<p;}
#include<iostream>
using namespace std; int main() { int p; bool a=true; bool b=false; int x=10; int y=5; p= ((x+y*2)+(a+b)) ; cout<<p;}
Anonymous Quiz
12%
31
17%
0
68%
21
4%
16
❤1
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q14) What is the output of the following loop?
int n;
hi : for(n=5;n>0;n--) {cout<<n; if(n==3) goto hi;}
int n;
hi : for(n=5;n>0;n--) {cout<<n; if(n==3) goto hi;}
Anonymous Quiz
6%
5431
17%
5421
24%
54321
52%
infinite loop
👍1
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q16) What will be the output
int z=1,a=3;
for(int i=1;i<=3;i++) z*=a; cout<<z;
int z=1,a=3;
for(int i=1;i<=3;i++) z*=a; cout<<z;
Anonymous Quiz
34%
3
55%
27
10%
9
1%
21
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q17) What will be the output
#include <iostream>
using namespace std ; int main () { int n; hi: if(n==3) goto hi;}
#include <iostream>
using namespace std ; int main () { int n; hi: if(n==3) goto hi;}
Anonymous Quiz
5%
Hi
24%
hi
22%
infinite loop
49%
nothing
💯1
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q18) What will be the output ?
int a = 5, b=10;
if (a > b && b>=0) cout << a; else if (b> a && a>=0) cout << b;
int a = 5, b=10;
if (a > b && b>=0) cout << a; else if (b> a && a>=0) cout << b;
Anonymous Quiz
9%
5
77%
10
15%
0
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q19) What will be the output?
int z=1,a=3,m=2; for(int i=1;i<=3) z*=a/3*m; cout<<z;
int z=1,a=3,m=2; for(int i=1;i<=3) z*=a/3*m; cout<<z;
Anonymous Quiz
19%
8
72%
error
9%
28
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q20) The goto statement is often used in old programming for control flow management.
Anonymous Quiz
71%
True
29%
False
👍1
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q21) In a C++ program, what does the cin statement do?
Anonymous Quiz
8%
A) Outputs data to the console
84%
B) Takes input from the user
6%
C) Terminates the program
2%
D) Skips a line
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
22) The for loop in C++ allows you to execute a block of code once based on a condition.
Anonymous Quiz
55%
True
45%
False
Forwarded from 𐩣 𐩢𐩱𐩸𐩣 𐩱𐩡𐩢𐩹𐩺𐩰𐩺
Q11) What is the output of the following loop?
int n;
for (n = 5; n> 0; n--) { cout <<n; if (n==3) continue;}
int n;
for (n = 5; n> 0; n--) { cout <<n; if (n==3) continue;}
Anonymous Quiz
7%
5431
54%
5421
34%
54321
5%
53
👍1😐1