Write a program that prompts the user for a positive integer

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

You need a program for the following assignment in my C and Unix course. Therefore, You need this program in C programming. Just something basic and simple will do.

Write a program that prompts the user for a positive integer and then computes the sum of all the digits of the number. For example, if the user enters 2784, then the program reports 21.

If the user enters 59, then the program reports 14. The program should work for any number having one to ten digits.

Reference no: EM132081131

Questions Cloud

Relationship between managers and employees : What is the impact of implementing a lean system on the relationship between managers and employees?
Journalize chang co entry for payment of the amount due : Grayson Co. sold merchandise to Chang Co. on account, $8,600, terms 2/15, n/30. The cost of merchandise sold is $5,160. Grayson Co. issued a credit memo.
Describe what weaknesses honda motor company : Describe what weaknesses and strengths Honda Motor Company has within their company?
What would have been harry company net income : What would have been Harry's Company's net income been in Year 2 assuming that Harry had initially decided not to use double declining balance depreciation
Write a program that prompts the user for a positive integer : Write a program that prompts the user for a positive integer and then computes the sum of all the digits of the number.
Prepare a purchases journal and a cash payments journal : Prepare a purchases journal and a cash payments journal to record the above transactions in chronological order. Ignore posting references for this exercise.
Make a program that shows a expression evaluator : You need a program that shows a expression evaluator. You can use numbers o caracters.
What amount should trans report as cost of goods sold : Trans Co, used a periodic inventory system. The following are inventory transaction for the month of January. Trams uses the average pricing method.
What are the key elements of effective internal analysis : What are the key elements of an effective internal analysis and why is it important to a strategic plan?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  End of the string and then print the results

Write a C++ code that declares a regular C++ null-terminated string that holds upto 20 characters, reads user input into the string, appends an exclamation to the end of the string and then print the results.

  Problem related to permutation

Write a recursively function that generates all the permutations of a set of numbers. Use the STL set class for all set operations and the STL linked list class to store and manipulate each individual permutation. When creating a set containing li..

  Compcets of office apps

Cell Reference is the location of a cell. Cells are located in columns marked by letters, and rows are marked by numbers. Example to reference a cell in column D row 10 you would reference it as D10.

  Insert the missing code in the c program

You are to insert the missing code in the C program given for combinational equivalence checking. This program will interface with the CUDD package and will parse netlist files in ISCAS85 circuit format. Next, BDDs will be created for each circuit an..

  Sum of all the numbers

Write a program that repeatedly asks a user to enter a number. The program will sum up all the number that the user keyed in. Terminate the program when the user enters -9, and display the sum of all the numbers entered by the user (exclude -9).

  Write a program that converts a char to ascii

Create a program that reads in an arbitrary number of items and stores them in a vector. Then output the contents of the vector. Write a program that converts a char to ascii.

  Write a recursive function squares

Write a recursive function squares that takes a list of numbers, and returns a new list of the squares of those numbers.

  Calculate gpa

You need to take input from user study year (proper value check from 1 to 4). Take input semester (proper value check 1 to 8) Calculate GPA (use Loop, calculate GPA for semester 1,2,3...)

  Write out the search value and the location

Write out the search value and the location in which it was found if it was found, and a ‘not found' message if not.

  Implement a program to process a weighted undirected graph

Read in the number of vertices V and the number of edges E of the graph followed by its E edges, each in the form u, v, w where 1 0 representing an edge uv with weight w.

  Appropriate structure to use to program the statement

A home improvement store is giving a discount of 20% on all purchases of more than $250. Which of the following is the appropriate structure to use to program the statement

  1 nbspwrite a c program to accept distance in kilometers

1. nbspwrite a c program to accept distance in kilometers coverts it to meters and then displays the result.2.

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