Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem B B.1 Specification Write a C program to input a line of characters in the form of a floating-point number, convert the line of

image text in transcribed

Problem B B.1 Specification Write a C program to input a line of characters in the form of a floating-point number, convert the line of characters into an actual floating point number, and display on the standard output the floating point number. B.2 Implementation The program is named lab4b.c. Use the given template lab4b.c and fill in your code. You are given an array of characters of size WAX SIZE where MAX SIZE = 100. The array is named my strg. Use getohar and a loop to read a line of characters, and store the input characters into array Fy_trg. The loop terminates when a new line character'n' is entered. The new line character In' is NOT part of the line (i.e., discard the new line character 'n The input line contains only characters to '9' and the dot character in the form of a valid positive floating point number of the following format: [integer part) [fractional part Convert the input line of characters to a double floating-point number, which is stored in variable Y_number. Display on the standard output the double floating point number my number using the print statement as follows: printf("%.2f ", my number); Assume that the input line of characters represents a valid floating point number of the form [integer part. [fractional part) B.3 Sample Inputs/Outputs Indigo 360 i lab45 24.50 Indigo 361 i la 45 76.2123 75.24 indigo 362 i la 45 200.0 09.00 ndigo 363 + lah 0.255 0.26 ndiyo 360 lat -2.9999999999 ndigo 365 lata 1.00000003599 Indigo 366la40

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

Which personal relationships influenced you the most?

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

How was your life influenced by those events?

Answered: 1 week ago