Can anyone help me with this C++ program?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.