you declare the variables as float but you read integer value(%d) try to change it