Computer Science, asked by mayankpandey73182511, 4 days ago

write a program to convert an integer into the corresponding floating point number. *Phython​

Answers

Answered by anindyaadhikari13
1

Solution:

The given problem is solved in Python.

number = int(input('Enter an integer number: '))

new_number = float(number)

print('Original Number:', number)

print('After converting to float:', new_number)

Explanation:

  1. Line 1: Accept the integer as input.
  2. Line 2: Converts the number to float using float() function.
  3. Line 3: Original number is displayed.
  4. Line 4: Number after conversion is displayed.

You can also check the type of variable using type() method.

Example: type(2.0) prints <class 'float'>

Refer to the attachment for output.

Attachments:
Similar questions