C Programming Round Math Homework

This question already has an answer here:

I've just started a class in C Programming, and while I have some background knowledge in JAVA, I'm trying to transition to this programming language. I have a project where I have to round user's input from something like 1.3333 to only two decimal places.

What I have so far is this:

This is what I have so far based off of what I've read in my book and this link: Rounding Number to 2 Decimal Places in C which my question is different from because it involves user input. My professor does say that I can't use a library function and need to use simple type casts to calculate it. This makes me feel that what I have might be wrong. Would the be considered a library function? Given this information, is my thought process on the right track? If not, then would I do something like divide by variable by 100? Maybe %e for scientific notation?

Thanks ahead of time! Only asking for specific information, not coding or anything. Really want to understand the "hows" and "whys".

c


Rounding Worksheets

Rounding Worksheets for Practice

Here is a graphic preview for all of the rounding worksheets. You can select different variables to customize these rounding worksheets for your needs. The rounding worksheets are randomly created and will never repeat so you have an endless supply of quality rounding worksheets to use in the classroom or at home. Our rounding worksheets are free to download, easy to use, and very flexible.

These rounding worksheets are a great resource for children in Kindergarten, 1st Grade, 2nd Grade, 3rd Grade, 4th Grade, and 5th Grade.

Click here for a Detailed Description of all the Rounding Worksheets.



Quick Link for All Rounding Worksheets

Click the image to be taken to that Rounding Worksheet.


Detailed Description for All Rounding Worksheets

Rounding Worksheets for Integers
These rounding worksheets are great for teaching children to round integer numbers to the nearest tens, hundreds, or thousands. These rounding worksheets are appropriate for Kindergarten, 1st Grade, and 2nd Grade.

Rounding Worksheets for Integers by Comparison
These rounding worksheets are great for teaching children to round integer numbers by comparison to the nearest tens, hundreds, or thousands. These rounding worksheets are appropriate for Kindergarten, 1st Grade, and 2nd Grade.

Rounding Worksheets for Decimals
These rounding worksheets are great for teaching children to round decimal numbers to the nearest tenths, hundredths, or thousandths. These rounding worksheets are appropriate for Kindergarten, 1st Grade, and 2nd Grade.

Rounding Worksheets for Money
These rounding worksheets are great for teaching children to round money to the nearest one and ten dollars. These rounding worksheets are appropriate for Kindergarten, 1st Grade, and 2nd Grade.

Rounding Arrows with Hundreds Charts
These rounding worksheets produce arrows on hundreds charts to help students learn how to round numbers to the nearest ten. These rounding worksheets are appropriate for Kindergarten, 1st Grade, and 2nd Grade.

Rounding Colors with Hundreds Charts
These rounding worksheets produce colors on hundreds charts to help students learn how to round numbers to the nearest ten. These rounding worksheets are appropriate for Kindergarten, 1st Grade, and 2nd Grade.


Categories: 1

0 Replies to “C Programming Round Math Homework”

Leave a comment

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *