Write a c program that reads an integer entered by the user

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

1-Write a C program that asks the user to enter a U.S dollar amount and then shows how to pay that amount using the smallest number of $20, $10, $5, $1, quarters, dimes, nickels, and pennies.

For example:
Enter a dollar amount: $78.49
$20 bills: 3
$10 bills: 1
$5 bills: 1
$1 bills: 3
Quarters: 1
Dimes: 2
Nickels: 0
Pennies: 4

2- Write a C program that reads an integer entered by the user and displays it in octal (base 8). The output should be displayed using five (5) digits, even if fewer digits are sufficient. Hint: To convert a number to octal, first divide it by 8; the remainder is the last digit of the octal number. Then divide the quotient by 8 and repeat the process to arrive at the next digit. (Do not use built-in C function to solve this problem. You must code it).

For example:
Enter a number between 0 and 32767: 2016
In octal, your number is: 03740

Reference no: EM13963156

Questions Cloud

Evaluate the effectiveness of previous marketing : Evaluate the effectiveness of previous marketing and positioning strategies of your chosen organisation to determine their effectiveness -  Identify and briefly discuss your chosen organisation's direction and marketing targets.
What is the rms value of the displayed signal : b) What is the value of the ac power that can perform the same amount of work as a 24 dc 0ne ?
Bonds to react to the announcement : RJR Nabisco also had $10 billion in bonds outstanding at the time of the dividend increase in Problem 1. How would you expect the bonds to react to the announcement? Why?
Estimate the number of meters in one light year : What's the difference between a logarithm of a product and the product of logarithms? Can you provide a simple example for each. Can you also be very detail in explaining the difference. I would really like to understand this more.
Write a c program that reads an integer entered by the user : Write a C program that reads an integer entered by the user and displays it in octal (base 8). The output should be displayed using five (5) digits, even if fewer digits are sufficient.
How you would integrate the data on the payscale website : Using external resources to gauge compensation levels may result in more equitable compensation planning. From the e-Activity, assess how you would integrate the data on the PayScale Website or similar sites into your compensation planning. Specif..
Revenues and earning dropped significantly : WeeMart, a retailer of children's clothes, announces a cut in dividends following a year in which both revenues and earning dropped significantly. How would you expect its stock price to react? Explain.
What is this critical speed : However, if you are going faster than a certain critical speed, there are some distances from the light for which you cannot do either (i.e. you are too far to make it through, and yet too close to stop). What is this critical speed?
Write a short paper on the network components : Perform research and write a short paper on the network components that make up a local area network.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Problem 1 integrationcreate a program to integrate an

problem 1. integrationcreate a program to integrate an arbitrary time-domain signal with variable limits of integration

  Individual genes are substrings of a genome

Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..

  Why does the neverwet spray protect it from water

As is know, acetone is a polar molecule like water, so isn't it suppose to mix? So my question is: why does the Neverwet spray protect it from water but not from oils and detergents?

  What are the contents of the array

What are the contents of the array after the subsequent loops complete - loops and also provide the iteration how to get it.

  Consists of an employee''s last name

Each input line consists of an employee's last name, first name, current base salary, total sales and percent commission. For example, in the first input line, the last name of the employee is Thomas, the first name is Andrew, the current base salary..

  Evaluate the mathematical constant of p

Write a C++ program to evaluate the mathematical constant of PI - Guess a random number between 0.00 and 1.00 and assign this to x.

  Compute the area of a circle

Develop the program that will convert the temperature from degree Celsius to degree Fahrenheit. User input the temperature in Fahrenheit. The relation is 1)  Develop the program that will convert the temperature from degree Celsius to degree Fahrenhe..

  Concepts of recursion

Write a 2 page research paper (excluding the title page) on recursion. Explain the concepts discussed in the textbook using at least an example not included in the textbook.

  Write function that is passe an array of n pointers to float

Write a function that is passed an array of n pointers to floats and returns a newly created array that contains those n float values. Implement a function for integrating a function by means of Riemann sums.

  We base our need to implement composition upon

What criterion, or criteria, should be used to include objects of a class as data members of another class? In other words, what should we base our need to implement composition upon?

  Design a nested program

How many levels of nesting are there in this design?

  Use selection sort to sort a[48] into increasing order

Use selection sort to sort A[48] into increasing order, and then print out the sorted list in four rows. There may be duplicates, but that's OK. (65 and 53 appear twice.) Duplicates will appear next to each other in the sorted list.

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