What will be the value of xafter executing the above switch

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

Question1.Consider the following function definition.

int func(int x) {

int i = x ;

while (i <= 10 ){

cout << i ;

i++ ;

}

return i ;

}

If a value 5 is passed to the above function then whatwill be the return value of function?

Question No 2. 

How many times will the following while loop execute, ifwe the value of i = 5?

while (i >= 5 ){

cout << i ;

i++ ;

}

Question No3.  

switch(x){

case 1:

x += 1 ;

break ;

case 2:

x += 2 ;

case 3:

x += 3 ;

break ;

case 4:

x += 4 ;

break ;

default:

          x += 10;

}

a) If x = 2, then what will be the value of xafter executing the above switch statement?

b) If x = 3, then what will be the value of xafter executing the above switch statement?

Reference no: EM13528826

Questions Cloud

Determine the torque needed to turn the impeller : A centrifugal pump is used to pump water from ariver. The absolute velocity V2 = 82ft/s is at an angle of 25 degrees to theradial direction. The impeller's thickness is of 1.2 in and r2= 0.86 ft and rotates at a speed of 1250 rpm.
What is the maximum pressure on the form in psf : What is the maximum pressure on the form in PSF?
If the desired flowrate is at least : Two reservoirs, which differ in surface elevation by 40m, areconnected by 350m of new pipe of diameter 8cm. If the desired flowrate is at least 500N/s of water at 20 degrees C. can the pipematerial be made of
What fraction of the flue gas stream can be bypassed around : A coal-fired power plant with an scrubber has an overall  removal efficiency of 85%. But rather than treat the entire stream to 85% removal
What will be the value of xafter executing the above switch : If x = 3, then what will be the value of xafter executing the above switch statement?
Alsogive the parameter rating in each of the fiveclasses : Giving the classes, explain how rocks are put intofive (5) classes by each of the above parameters. Alsogive the parameter rating in each of the fiveclasses. Hint; use a table to answer this question
Discuss the applicability of grouting technology inimproving : Rock masses that donot have the desired properties for a givencivil engineeering application are improved. The method of choicedepends on the purpose for which the rock mass is intended. amongthe common methods for increasing the strength of fissured..
Explain each of the parametersin the equation is obtained : According to barton(1974) the quality of a given rock mass can bedetermined using the equation below. explain each of the parametersin the equation is obtained.
Explain the meaning of the reliability index ß : Explain the meaning of the reliability index,β, and how it relates to failure / survival inthe context of bridge design? What is the value ofβ we use in design?

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