Convert cm to mm

 Convert cm to mm


C Program
#include <stdio.h>
#include <stdlib.h>
int main()
{
    float a,res;
   printf("Enter number in cm:");
   scanf("%f",&a);
   res = a*10;
   printf("%f cm is %f mm",a,res);
}


Java Program
import java.util.Scanner;

public class SimpleProgram {

	public static void main(String[] args) 
	{
		Scanner s = new Scanner(System.in);
		System.out.print("Enter  Number in cm:");
		float a = s.nextFloat();
		System.out.print(a +" cm is " + (a*10) + " mm");

	}

}


Python Program
x = int(input("Enter a number: ")) 
print(str(x) + " Cm is " + str(x*10) + " mm")

0 Comments:

Post a Comment