Questions tagged as 'inteiros'

3
answers

How could I read a 3-digit value and print them on the screen inverted in C?

If I store the value '123' in an integer variable, how could I print the contents of the variable on the screen inverted? For example, for the value '123' the expected output would be '321'; for '472' would be '274'.     
asked by 14.10.2017 / 17:17
1
answer

Integer array conversion in String

I am a beginner in Java and would like to learn how to convert an array of integers to a String.     
asked by 24.06.2014 / 05:50
2
answers

Return whole part in JavaScript

What's the difference between these methods in JavaScript? console.log(parseInt(3.3)); console.log(parseInt(3.7)); console.log(Math.floor(3.3)); console.log(Math.floor(3.7)); console.log(Math.trunc(3.3)); console.log(Math.trunc(3....
asked by 25.04.2018 / 20:11
2
answers

Integer reading via console

Good evening, everyone. A basic question: In the code below class Conversora { double Oneknot = 1.852; // km/h public void Conversor(){ Console.WriteLine("Informe a velocidade em nós: " ); int speed =...
asked by 26.10.2017 / 04:43
2
answers

Read multiple integers in the same input in C

Basically, I should insert a number that represents the number of integers to insert. Then insert the integers into each other, separated by space, in the same input. Example: 5 1 2 3 4 5 I tried to perform the following repetition,...
asked by 03.04.2014 / 22:15
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
1
answer

Error reading% f and% e of a file in C

In the following snippet of my code I have to read a function from a txt file and extract its coefficients. When I put the coefficients as integers and reading them with %d works correctly, but when putting the coefficients with floating...
asked by 10.07.2014 / 04:11
4
answers

Integer with 0 on the left is printed as another number

I have this code: $mob_numbers= array(02345674, 12345675, 22345676, 32345677); echo ($mob_numbers[0]); I wanted to print the first element of array but the output of that is:    641980 Why does this happen?     
asked by 14.03.2014 / 13:17
0
answers

Read Integer with BufferedReader on Android

In an Android Application, I have a socket client java that sends integers (using writeInt) to a socket server on Android that I am trying to read these integers. I get strings correctly but can not convert when using parseInt, Here and Here...
asked by 06.10.2017 / 03:27
1
answer

More elegant ways to reverse integers, arrays, and strings in Python

Save! I've been looking for elegant ways to reverse strings, arrays, and integers in Python. What do you think of my codes below and what do they suggest to improve them? They work ... Thank you! frase = 'eu gosto de python'[::-1] num...
asked by 28.10.2015 / 00:33