I need help writing a simple program in "C". Can anyone help? Please see details.?
-
I need to write a program that prompts the user to enter a floating-point number. The program will then print the number entered, first in decimal-point notation and then in exponential notation. Have the output use the following format: The input is 21.290000 or 2.129000e+001. Hint: %d or %i is used for integers, %f is used for floating point, %e is used for exponential notation PLEASE HELP ME....I AM LOST HERE!!!
-
Answer:
#include <stdio.h> int main () { float f; printf ("Enter a number: "); scanf ("%f", &f); printf ("The number in Decimal-point notation: %10.5f \n", f); printf ("The number in exponential notation: %e \n", f); } Hope this helps... the number between %...f (10.5) gives you field length. 10 is total field lenght (including . point) and 5 give number of digits after decimal.
dharmabe... at Yahoo! Answers Visit the source
Related Q & A:
- I need help with a song I heard.Best solution by Yahoo! Answers
- I need help writing an objective for my resume.Best solution by resume-help.org
- I need help with a Romeo and Juliet essay.Best solution by Yahoo! Answers
- I need help choosing a camera.Best solution by Yahoo! Answers
- I need help simplifying a rational expression.Best solution by purplemath.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.