Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to express a length given in milimeters in meter and centimeters

Posted By: Luca Evans     Category: C Programming     Views: 3888

Write a program to express a length given in milimeters in meter and centimeters.

Code for Program to express a length given in milimeters in meter and centimeters in C Programming

#include<stdio.h>

void main()
{
        float number1,number2,number3;
        printf("Entet the number in milimeter ");

        if(scanf("%f",&number1)==1)
        {
                number2=number1/10;
                number3=number1/1000;
                printf(" \nYour answer in centimeter =%0.2f",number2);
                printf("\nYour answer in meter =%0.2f",number3);
        }
else
{
        printf("error,enter correct value");
}
}

===================================OUTPUT================================

Entet the number in milimeter =>10021

Your answer in centimeter =1002.10
Your answer in meter =10.02
  
Share: 



Luca Evans
Luca Evans author of Program to express a length given in milimeters in meter and centimeters is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!