View Single Post
Old 03-31-2005, 02:40 PM   #1 (permalink)
destin
Java Junkie
 
destin's Avatar
 
Join Date: Mar 2005
Posts: 40
destin is on a distinguished road
Question Why doesn't this work?

ok this may seem like a silly question.. but why doesn't this work?

Code:
#include <stdio.h>
#include <math.h>

int main()
{
    double x;
    
    printf("Find the square root of: ");
    scanf("%f", &x);
    
    double i = sqrt(x);
    
    printf("%f", i);
    return(0);
}
This is what it displays when i input 9:
Code:
Find the square root of: 9
0.000000

Last edited by destin; 03-31-2005 at 04:50 PM.
destin is offline   Reply With Quote