Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: (Dangling Else Problem) Determine the output for each of the following when x is 9 and y is 11, and when x is 11 and y is 9. The compiler ignores the indentation in a C program. Also, the compiler always associates an else with the previous if unless told to do otherwise by the placement of braces {}. Because, on first glance, you may not be sure which if an else matches, this is referred to as the "dangling else" problem. We eliminated the indentation from the following code to make the problem more challenging. [Hint: Apply indentation conventions you have learned.]

a) if (x < 10)

if (y > 10)

puts ("*****");

else

puts("#####");

puts("$$$$$");

b) if (x < 10) {

if (y > 10)

puts ("*****");

}

else {

puts("#####");

puts("$$$$$");

}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92416841
  • Price:- $15

Priced at Now at $15, Verified Solution

Have any Question?


Related Questions in Computer Engineering

The switch statementhere is the question in its entirety

The switch statement Here is the question in its entirety, but the actual problem is at the end. I just felt that I would give an overview of what I am asking. The program has to be in c++ (.cpp) and must compile as such ...

Smartphones have become an important part daily life

Smartphones have become an important part daily life, including how we communicate in business. Mobile device security is emerging as one of top targets for cybercriminals. Using Microsoft Word, write a 400 word paper us ...

Question a series of information frames with a mean length

Question : A series of information frames with a mean length of 1000 bits is to be transmitted across a data link 4000km long at a data rate of 2Mbps. If the link has a velocity of propagation of 2 *10 8 ms -1 and a BER ...

Question suppose we know a lt b ie a reduces to b in linear

Question : Suppose we know A (a) What can be said about the running time for A? (b) What can be said about the running time for B?

Reduce setup timehammond inc has analyzed the setup time on

Reduce Setup Time Hammond Inc. has analyzed the setup time on its computer-controlled lathe. The setup requires changing the type of fixture that holds a part. The average setup time has been 135 minutes, consisting of t ...

Given the ultra-high abundance of their elements in air it

Given the ultra-high abundance of their elements in air, it is not surprising that these six compounds are common pollutants: NO, NO2, N2O, N2O3, N2O4, N2O5. Calculate the largest ratio of effusion rates that exists betw ...

1 what is the price of a semiannual 1000 par value bond

1) What is the price of a semiannual $1,000 par value bond with four years left until maturity that pays a coupon of 3.75% and is yielding 5.25%? What would it be yielding if the price decreased to $973.47? Assume semian ...

Question you have been asked to help promote a new bill in

Question: You have been asked to help promote a new bill in your state, to which there is much opposition to this bill. Discuss what distributive bargaining is. Discuss the pros and cons which might arise toward the pass ...

Iq test scores of students are normally distributed with

IQ test scores of students are normally distributed with mean μ=100 and standard deviation σ=10. What is the 33th percentile of the IQ scores? For a randomly chosen student, what is the probability that his or her IQ sco ...

A 1000 utility bond with 14 years remaining before maturity

A $1000 utility bond with 14 years remaining before maturity can now be purchased for $760. It pays interest of $20 each 6-month period. What rate of return is earned by purchasing the bond at the current market price pl ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As