C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 8, Problem 8.27E
Program Plan Intro

Program Plan: 

  • Declare variable str of the character of array type in main function.
  • Declare variable number of integer type in main function.
  • Declare variable i, number and length of integer data type in strToNum function.
  • Calculate the length of string using strlen function in strToNum function.

Program Description: 

The following program will take convert string representation of a number from user and convert this string to number using user define function strToNum.

Blurred answer
Students have asked these similar questions
(Reversing Digits) Write a function that takes an integer value and returns the number withits digits reversed. For example, given the number 7631, the function should return 1367.
(Count the letters in a string) Write a function that counts the number of letters in a string using the following header: def countLetters(s) : Write a test program that prompts the user to enter a string and displays the number of letters in the string. the answer should be in python.
4. (Prime Numbers) An integer is said to be prime if it is divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime, but 4, 6, 8 and 9 are not. Write a function called isPrime that receives an integer and determines whether the integer is prime or not. Write a test program that uses isPrime to determine and prints all the prime numbers between 1 and 1000. Display 10 numbers per line.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning