Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

C++ Programming

Which of the following statements is correct about the array declaration given below?

Question: Which of the following statements is correct about the array declaration given below?

[A].

intMyArr refers to a 2-D jagged array containing 2 rows.

[B].

intMyArr refers to a 2-D jagged array containing 3 rows.

[C].

intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.

[D].

intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.

Answer: Option C

Explanation:

No answer description available for this question.

Which of the following statements is correct about the array declaration given below? Read More »

Arrays, C Sharp Programming

Which of the following statements mentioning the name of the array begins DOES NOT yield the base address?

Question: Which of the following statements mentioning the name of the array begins DOES NOT yield the base address?

[A].

A

[B].

A, B

[C].

B

[D].

B, D

Answer: Option B

Explanation:

The statement 1 and 2 does not yield the base address of the array. While the scanf() and printf() yields the base address of the array.

Which of the following statements mentioning the name of the array begins DOES NOT yield the base address? Read More »

Arrays, C Programming

Cpp Programming Quiz 1 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?


#include
int BixFunction(int m)
{
m *= m;
return((10)*(m /= m));
}
int main()
{
int c = 9, *d = &c, e;
int &z = e;
e = BixFunction(c-- % 3 ? ++*d :(*d *= *d));
z = z + e / 10;
cout<< c << " " << e;
return 0;
}

[A]. It will result in a compile time error.
[B].The program will print the output 64 9.
[C]. The program will print the output 64 10.
[D]. The program will print the output 64 11.

Answer: Option D

Cpp Programming Quiz 1 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 2 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?


#include
int main()
{
int x = 10, y = 20;
int *ptr = &x;
int &ref = y;

*ptr++;
ref++;

cout<< x << " " << y; return 0; }

[A]. The program will print the output 10 20.
[B]. The program will print the output 10 21.
[C]. The program will print the output 11 20.
[D]. The program will print the output 11 21.
 
Answer: Option B

 

Cpp Programming Quiz 2 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 3 – What will be the output of the program given below?

Question: What will be the output of the program given below?

#include
class BixBase
{
int x;
public:
BixBase(int xx = 0)
{
x = xx;
}
void Display()
{
cout<< x ; } }; class BixDerived : public BixBase { int y; public: BixDerived(int yy = 0) { y = yy; } void Display() { cout<< y ; } }; int main() { BixBase objBase(10); BixBase &objRef = objBase; BixDerived objDev(20); objRef = objDev; objDev.Display(); return 0; }

[A].0
[B].10
[C].20
[D].Garbage-value 

Answer: Option C

Cpp Programming Quiz 3 – What will be the output of the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 4 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?

#include
int main()
{
int m = 2, n = 6;
int &x = m++;
int &y = n++;
m = x++;
x = m++;
n = y++;
y = n++;
cout<< m << " " << n; return 0; }

[A].The program will print output 3 7.
[B].The program will print output 4 8.
[C].The program will print output 5 9.
[D].The program will print output 6 10.

Answer: Option E

Cpp Programming Quiz 4 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 5 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?

#include
int main()
{
int m = 2, n = 6;
int &x = m;
int &y = n;
m = x++;
x = m++;
n = y++;
y = n++;
cout<< m << " " << n; return 0; }

[A].The program will print output 2 6.
[B].The program will print output 3 7.
[C].The program will print output 4 8.
[D].The program will print output 5 9. 

Answer: Option C

Cpp Programming Quiz 5 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 6 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?

#include
int main()
{
int x = 0;
int &y = x; y = 5;
while(x <= 5) { cout<< y++ << " "; x++; } cout<< x; return 0; }

[A].The program will print the output 5 6 7 8 9 10.
[B].The program will print the output 5 6 7 8 9 10 7.
[C].The program will print the output 5 7.
[D].It will result in a compile time error. 

Answer: Option C

Cpp Programming Quiz 6 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 7 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?

#include
class IndiaBix
{
int x, y;
public:
IndiaBix(int xx = 0, int yy = 0)
{
x = xx;
y = yy;
}
void Display()
{
cout<< x << " " << y; } IndiaBix operator +(IndiaBix z) { IndiaBix objTemp; objTemp.x = x + z.x; objTemp.y = y + z.y; return objTemp; } }; int main() { IndiaBix objBix1(90, 80); IndiaBix objBix2(10, 20); IndiaBix objSum; IndiaBix &objRef = objSum; objRef = objBix1 + objBix2; objRef.Display(); return 0; }

[A].It will result in a runtime error.
[B].It will result in a compile time error.
[C].The program will print the output 9 4.
[D].The program will print the output 100 100. 

Answer: Option D

Cpp Programming Quiz 7 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References