Computer Science: A Structured Programming Approach Using C, Third Edition
Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 2, Problem 36PS
Program Plan Intro

To create a program that displays the the five integers, such as 1, 10, 100, 1000, and 10000 in a single line using different conversions, such as %d and %f in separated lines. It also asks for providing explanation regarding the differences.

Program Plan:

To create a code which define 5 variables of integer type and initialize those variables to 1, 10, 100, 1000, and 10000, respectively. The code displays those value in a one line separated or divided by space characters with the help of the decimal conversion code, (%d), using the float conversion code in next line, (%f). It also asks for providing explanation regarding the differences.

Blurred answer
Students have asked these similar questions
Python Write a program that receives a number from a user and checks if it's float or integer.In case of being float, print for the user that his/her number is float with integer part andfractional part. In case of being integer, print to the user that his/her number is aninteger and odd/even numbeR
Write a program that inputs four strings that represent floating-point values, converts the strings to double values, sums the values and prints the total of the four values.
What's the difference between a float and a double integer, exactly?

Chapter 2 Solutions

Computer Science: A Structured Programming Approach Using C, Third Edition

Ch. 2 - To print data left justified, you would use a in...Ch. 2 - Prob. 12PSCh. 2 - One of the most common errors for new programmers...Ch. 2 - Which of the following is not a character constant...Ch. 2 - Which of the following is not an integer constant...Ch. 2 - Which of the following is not a floating-point...Ch. 2 - Prob. 17PSCh. 2 - Which of the following is not a valid identifier...Ch. 2 - What is the type of each of the following...Ch. 2 - What is the type of each of the following...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - Which of the following identifiers are valid and...Ch. 2 - What is output from the following program...Ch. 2 - Prob. 24PSCh. 2 - Find any errors in the following program....Ch. 2 - Find any errors in the following program....Ch. 2 - Prob. 27PSCh. 2 - Prob. 28PSCh. 2 - Prob. 29PSCh. 2 - Code the variable declarations for each of the...Ch. 2 - Code the variable declarations for each of the...Ch. 2 - Write a statement to print the following line....Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses four print statements to...Ch. 2 - Write a program that uses defined constants for...Ch. 2 - Prob. 36PSCh. 2 - Prob. 37PSCh. 2 - Write a program that prompts the user to enter an...Ch. 2 - Write a C program using printf statements to print...Ch. 2 - Write a program that reads a character, an...Ch. 2 - Write a program that prompts the user to enter...Ch. 2 - Write a program that reads 10 integers and prints...Ch. 2 - Write a program that reads nine integers and...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY