Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

WRITE THE CODE IN C PLEASE. Description For the lab assignment, you may use any C statements you wish. However, you will get bonus points

WRITE THE CODE IN C PLEASE.

image text in transcribed

Description For the lab assignment, you may use any C statements you wish. However, you will get bonus points if you correctly solve the problem without using the if statement, the if/else statement, nor the while statement. Similar to the prelab, you are to convert integers to words. For example, if the integer is 1 , you should print "one". If the integer is 2, you should print "two". Do not "hard code" things (i.e., don't just print "one two three four five six seven eight nine ten" but instead loop through all the integers). You may use a for loop or a do/while loop to accomplish this. Inside your loop, you will need some way to decide what to print based on the value of the current integer. To accomplish this part, consider using a switch or the ternary operator. The difference this time is that you need to print all integers from 1 through 99 ! Don't worry about hyphenating and don't worry if there is an extra space or two floating around. Do, however, put a comma between each number (so we can easily tell which is which). If you have an extra comma or two floating around, don't sweat that either. Hints - Structure your code so you print a word that corresponds to each digit. How can you figure out what each digit of an integer is? Well, how about good old integer division? - Don't worry about the "teens" at first. Start with just pretending that ten is "teen", eleven is "teen one", and twelve is "teen two" (if English made any sense, that's what it would be anyway). If you get everything else done, you can always go back and try to deal with the teens

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 SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions