Questions tagged as 'float'

1
answer

Why do these two identical codes, one in C ++ and another and Java, give different results? [closed]

I'm trying to resolve an issue in the Online Judge URI in Java however I'm remarking 5 % error, and from what I've studied is being caused by the fact that the precision of the variables in C ++ and Java is different. I've tried everything to...
asked by 05.10.2018 / 06:30
1
answer

Problem with float and array

I have to add the values that have two or more decimal places but when I put it on exp: "1.0", it fills the whole row automatically and jumps to the next, I reviewed and I do not know why it is giving error so thank you if you can help. #inclu...
asked by 29.09.2016 / 23:06
1
answer

PDO SQLSTATE [07002]: COUNT field incorrect or syntax error [duplicate]

I'm having trouble making a decrease in sql with pdo. I'm getting the following error   SQLSTATE [07002]: [Microsoft] [ODBC Driver 11 for SQL Server] COUNT field incorrect or syntax error code <?php ob_start(); include'../../classe...
asked by 30.10.2016 / 21:58
1
answer

Calculate the number of hours between two hours and transform into float

I needed to create a function that received two hours in the format (00:00:00), calculates the number of hours between them, and converts me to float. However the float would be of this genre: Resultado: 2 horas e 30 min -> 2,30 Resultad...
asked by 13.05.2016 / 19:16
1
answer

Change number of digits after the comma depending on the situation [duplicate]

I know I can get a digit bound after the comma with %.2f to float and %.2lf to double . How can I change this limit depending on the occasion? For example: Get a two-digit limit with float that would...
asked by 09.07.2017 / 03:54
2
answers

How to get the rest of a float number in C?

This question is the one of the URI I thought of this idea more when I will take the rest of float numbers I can not ... #include <stdio.h> int main(int dinheiro) { int res, res2; Here I have an array of integers that I think sho...
asked by 26.11.2017 / 03:57
1
answer

Evaluative activity hours per minute

   Question (2): Make a program that receives an hour consisting of hour and minutes (a real number), calculate and show the time entered in minutes. Consider that:       For four-thirty (4:30), enter 4.30;    For four and fifty (4:50), you m...
asked by 07.04.2017 / 17:03
1
answer

Program to calculate media

#include <stdio.h> #include <stdlib.h> int main() { int sum = 0; int times = 0; int number; int average; while ( number != 9999 ){ printf( " Type the number and i will make the average, 9999 to end:\n "...
asked by 07.12.2016 / 02:29
1
answer

Div with float does not fit the grid

I'm developing a website and it should list some specifications of a system. There are several lists of varied heights. Problem: I use float: left in all lists. I hoped the lists would fit automatically, with the right as far as the left. But as...
asked by 07.05.2015 / 18:58
1
answer

Why does the variable x of double always print the same value WRONG in scientific notation?

In this first example I would like to know why the variable x handles double, when it is formatted by the function "printf ()" does not display the value correctly, and every time the value is the same. #include <stdio.h> int main(){...
asked by 11.10.2017 / 00:53