Question

What is the final value of x in memory after the code below is run? 1 int x; 2 for (x=0; x<5; x++){ 3 4} Answer: Answer

What is the result of the following bitwise operation in decimal? ((~6)&36)|(6)&(~36)), where ~, |, and & are the bitwise NOT

Complete the attempt to allocate a 5-element array of pointers to doubles and initialise the associated double value to 0.0.

The three fundamental steps associated with writing good C++ code in the correct order are: Select one: a. Coding; Design; an

What is the result of the following bitwise operation in decimal? 6 & 36, where & represents the bitwise AND. Answer: Answer

What will be the result of shifting the decimal value 32 if we shift it 2 bits to the left. Give your answer in decimal. Answ

How many arguments does a destructor take? (give your answer as an integer) Answer: Answer

int main(void) { Chain c1, c2; float z; c1.insertintegerData(12); z= c2.insertFloatData(); cout << You have << z; return 0;

0 0
Add a comment Improve this question Transcribed image text
Answer #1

What is ... ?

x=5

What ... ?

34

Comp .. .

double* a[10];
for(int j=0;j<5;j++){
a[j] = new double;
*a[j] = 0.0;
}

The ... .

(C)

What .. ?

4

What ... ?

0

Since only the MSB is 1 in 32, shifting that to left will make all bits 0.

How many ?

0

For last question no details of Chain given.

Add a comment
Know the answer?
Add Answer to:
What is the final value of x in memory after the code below is run? 1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (a) Consider the following C++ function: 1 int g(int n) { 2 if (n == 0)...

    (a) Consider the following C++ function: 1 int g(int n) { 2 if (n == 0) return 0; 3 return (n-1 + g(n-1)); 4} (b) Consider the following C++ function: 1 bool Function (const vector <int >& a) { 2 for (int i = 0; i < a. size ()-1; i ++) { 3 for (int j = i +1; j < a. size (); j ++) { 4 if (a[i] == a[j]) return false; 5 6 } 7 return...

  • How would I be able to get a Merge Sort to run in this code? MY...

    How would I be able to get a Merge Sort to run in this code? MY CODE: #include <iostream> #include <fstream> #include <stdlib.h> #include <stdio.h> #include <time.h> using namespace std; class mergersorter { private:    float array[1000] ;    int n = 1000;    int i=0; public:    void fillArray()    {        for(i=1;i<=n;i++)        {            array[i-1]= ( rand() % ( 1000) )+1;        }    }    void arrayout ()    {   ...

  • 1.   What will be the value of x after the following code is executed? int x...

    1.   What will be the value of x after the following code is executed? int x = 10, y = 20; while (y < 100) { x += y; } A.   90 B.   110 C.   210 D.   This is an infinite loop 2.   If a superclass has constructor(s): A.   then its subclass must initialize the superclass fields (attributes). B.   then its subclass must call one of the constructors that the superclass does have. C.   then its subclass does not inherit...

  • Why is the assertion failing? what code can fix the problem and where should that code...

    Why is the assertion failing? what code can fix the problem and where should that code be located at? class Point { public: Point() { myX = myY = 0; } Point(int n, int y) { myx = x; myy = y; } int getX() const { return myX; } int getY() const { return myY; } virtual void read(istream& in) { in >> myX >> myY; } private: int myx, myY; }; class Point3D : Public Point { public:...

  • 1,4,5 Multiple Choice (Find Output or Fix Error) 1. What will be the final value of...

    1,4,5 Multiple Choice (Find Output or Fix Error) 1. What will be the final value of product 7、 inta,b; Given above code, what will be the value of a andb if user types: 31 42 nt producr- 3, product 3 prodct while (product70) a) 81 31 What is the output of the following code? char Grade8 27 8. d) Error in do-while code 2. This loop is a good choice when you know how many times you want the loop...

  • 2. What is the value of x alter the following code is executed # include<iostream> using...

    2. What is the value of x alter the following code is executed # include<iostream> using namespace std; int main int t-0, c- 0,x-3; while (c < 4) t=t+x; cout << x return 0; a) 3 b) 21 c) 24 d) 48 3. What is the output of the following code? # include<iostream> using namespace std; int main0 int a- 3; for (int i 5; i >0; i) a a+i cout << a << “ “ return 0; d) 8...

  • Consider a C function negMat(), that negates each element of a K x K matrix y[][],...

    Consider a C function negMat(), that negates each element of a K x K matrix y[][], and stores each result into the matrix x[][] : void negMat(float *x, float *y, int K) { int i, j; for (i=0; i<K; i++) { for (j=0; j<K; j++) { x[i * K + j] = - y[i * K + j]; } } } negMat() runs on the CPU (obviously), and x[][]and y[][] are stored in row-major order. Write a CUDA kernel negMatGPU(),...

  • Question 28 What is the output of the following program? Assume code is correct. #include <iostream>...

    Question 28 What is the output of the following program? Assume code is correct. #include <iostream> using namespace std; int main() { int i = 1,j,x = 5, y = 4; while (i <= y) { for (j = 0; j <= y2; j++) cout << 'Z'; cout << endl; i=i+1; } return 0; 3 B IV AA-I E333 X X, B, GT 12pt Paragraph

  • Can some one fix my code so that the output result same as below? BAR PLOT...

    Can some one fix my code so that the output result same as below? BAR PLOT OF CYLINDER PRESSURE -VS- TIME pressure is on horizontal axis - units are psi time is on vertical axis - units are msec    0.0         20.0        40.0          60.0        80.0       100.0      120.0       +---------+---------+---------+---------+---------+---------+ 0.0|************************* 1.5|********************************* 3.0|***************************************** 4.4|**************************************************      05.9|********************************************* 7.4|******************************** 8.9|*********************** 10.4|***************** 11.9|************** 13.3|************* 14.8|************ 16.3|********* 17.8|******* 19.3|****** 20.7|****** 22.2|******* 23.7|******* .......... ===================== her is my code //#include"stdafx.h" #include #include #include #include #include #include using...

  • Question 15 After the following code executes, what is the output if user enters 0? int...

    Question 15 After the following code executes, what is the output if user enters 0? int x =-1; cout << "Enter O or 1:"; cin >> X; if (x) cout << true else cout << false O nothing will be displayed true O false 0

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT