I'm relatively new to C programming and I am trying to make a program to take and print the natural log of a number input by the user but for some reason my program always returns incorrect answers. For example I entered 1 as my number, and the answer came back as some ridiculously big value which is clearly wrong as I know that ln 1 = 0.(adsbygoogle = window.adsbygoogle || []).push({});

My source code is given below, any help would be greatly appreciated :)

Code (Text):

#include <stdio.h>

#include <math.h>

int main(void)

{

float in;

float out;

do {

printf("Enter the number to take ln of...\n");

scanf("%f", &in);

out = log(in);

printf("Ln of %f is %f\n", &in, &out);

printf("If you want to do this again press 1, if not press any other number\n");

getchar();}

while(1==1);

}

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Trying to make a program to take and print the natural log of a number input

**Physics Forums | Science Articles, Homework Help, Discussion**