What is the value after the following code executes

Assignment Help C/C++ Programming
Reference no: EM132080109

You need some help understanding why the following code compiles the way it does. These were questions that you recently had on test.

The point of this test was to see our knowledge of "braces" locations within the code. So this code is missing braces.

1. What is the value after the following code executes?

int (donuts = 10;

if (donuts!= 10)

donuts = 0;

else

donuts += 2;

Answers:

A. 12

B. 10

C. 0

D. 2

2. What is the value of donuts after the following code executes?

int donuts = 10;

if (donuts = 1)

donuts = 0;

else

donuts +=2;

Answers:

A. 12

B. 10

C. 0

D. 1

Reference no: EM132080109

Questions Cloud

Develop an athlete class that has the persons name : Develop an Athlete class that has the person's name, sport, and ranking, where the name and sport are Strings and the ranking is anything.
How much time tmelts passes before the ice starts to melt : From the time when the heating begins, how much time trise does it take before the temperature begins to rise above 0degreesC?
What is needed to interface to the lcd : The pin numbers in thedefinition of LcdDriver are critical and are based on the traces from the schematic.
What is the maximum number of simultaneous calls : What is the maximum number of simultaneous calls a CDMA system with a processing gain of 30 dB, an Eb/No of 13 dB and inter-cell interference factor.
What is the value after the following code executes : The point of this test was to see our knowledge of "braces" locations within the code. So this code is missing braces.
Set of reworks go off in the order : The most common colours in reworks are red, orange, yellow, green, blue, and purple. A student is watching a rework show and sees a set of reworks go off
Draw a truth table to represent the problem : Draw a truth table to represent the problem and use it to construct a Karnaugh map. Construct a circuit to implement the function using NAND gates only.
Test for balanced parenthesis and balanced brackets : Write a program to read in a text file (of your own making) and test for balanced parenthesis and balanced brackets. Call the file: "assn3data.txt".
What will the final temperature be in kelvin : The pressure doesn't change and the amount of gas in the balloon doesn't change.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd