So here's the part of my code I'm having trouble with.
The error says %f is for floats and n is a double, which I've seen in lots of other questions, but the answer was to put in a %1f instead and it still gives back the same error when I try to compile.
#include <stdio.h>
#include <math.h>
int main()
{
//declaring variables
double n, new_guess, guess;
//getting data from the user
printf ("Enter a number: ");
scanf ("%1f", &n);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…