Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ 1. Given the following code, what would you add to this code in so that the value of 5 is written out to the

c++

1. Given the following code, what would you add to this code in so that the value of 5 is written out to the screen?

#include

int main(){

int* number = new int(5);

//missing code

delete number;

}

2. What, if anything, is wrong with the code below?

#include

int main() {

int a = 1;

int b = 2;

int c = add(a,b);

}

int add(int num0, int num1){

return num0 + num 1;

}

3. Write code that will create an array of twelve floats and add random values to that array. Then print out those values to the console. There is no need to create any functions and you can assume that all necessary libraries have been imported.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions