program to convert meter into centimeter
Answers
Answered by
12
#include <stdio.h>
void main()
{
int i;
printf("pls enter a value in meters\n");
scanf("%d",&i);
i*=100;
printf("\n value in centimeters is %d",i);
}
jainaditya0411:
The program is in C programming language
Answered by
4
The python program for the above is stated below :
Explanation:
number=int(input("Enter a number into meter")) #take the input from the user.
print("The Centimeter of the "+ str(number)+" meter is "+str(number*100)) // convert the number into Centimeter and print it.
Output:
- If the user enter 5 then the output is 500.
- If the user enter 4 then the output is 400.
Code explanation :
- The first line of the program prints the message to the user and take input from the user and convert the number into integer data type because the input comes from the user is in string data type.
- The second line of the program print after converting the meter value into centimeter by multiplying it with 100 and convert this variable into string data type because there is a need for string data type when we use '+' operator to add two string in print statement.
Learn More:
- Python: brainly.in/question/8153418
- Python program: https://brainly.in/question/14425238
Similar questions
Chemistry,
7 months ago
Social Sciences,
7 months ago
Math,
1 year ago
Biology,
1 year ago
Math,
1 year ago