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

  Implementnbsp the lsquoguess the word game in an

implementnbsp the lsquoguess the word game in an object-oriented manner. this program would add some basic manipulation

  Asignment1questionwrite a recursive function void reverse

assignment1questionwrite a recursive function void reverse that reverse a sentence.for examplesentence greeting new

  Reads from the external file input.txt

Program that reads from the external file input.txt, counts the letters in every word, replaces the word by that number, and then writes the numbers to an external file output.tx

  The mean and standard deviation

How do i write a program in c++ that use functions max, min, the total numbers, the mean and standard deviation to read a file text and return these values from the file text. note the file text has random numbers. note im not suppose to use arrays.

  Write a program that displays the cubes of the numbers

Write a program that displays the cubes of the numbers from 1 to 10. Recall that the cubes of a number is just the number multiplied by itself and then by itself again.

  Write a for loop that adds the integers

Assume the int variables i , lo , hi , and result have been declared and that lo and hi have been initialized. Write a for loop that adds the integers between lo and hi (inclusive), and stores the result in result .

  Extend the definition of the class clocktype by overloading

a. Extend the definition of the class clockType by overloading the post-increment operator function as a member of the class clockType

  Write a program using vectors and iterators

Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulating it mathematically, eventually outputs your entire phone number. The d..

  Write a program that creates an arraylist

Write a program that creates an ArrayList and adds a Loan Object, a Date Object, a string, JFrame object, and a circle object to the list, and use a loop to display all the elements in the list by invoking the object's toString() method.

  Design an algorithm to find the selling price

To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store. What information do you need to find the selling price?

  Implement a standard sorted linked list class

Write C++ Program:Implement a standard SORTED linked list class. Be sure to include constructor/copy constructor, destructor, and assignment operator overload.

  You have just upgraded your system

You have just upgraded your system to a "fast and wide" SCSI interface. This system has a floppy disk, a CD-ROM and five 8-gigabyte fixed disks. What is the device number of the host adapter? Why?

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