The distance between two cities (in km).is input through the keyboard Write a program to convert to print the distance in meters feet,imches and centimeter.

 The distance between two cities (in km). is input through the keyboard Write a program to convert to print the distance in meters feet, inches and centimeter.

  program--

\\conversion of distance

#include<stdio.h>

int main()

{

float km,m,cm,ft,inch;

printf("\n Enter the distance in kilometer :");

scanf("%f",&km);

m=km*1000;

cm=m*100;

inch=cm/2.54;

ft=inch/12;

 printf("Distance in meters=%f\n",m);

 printf("Distance in centimeter=%f\n",cm);

printf("Distance in feet=%f\n",ft);  

printf("Distance in inches=%f\n",inch);  

 return 0;

}

 OUTPUTs --

 Enter the distance in kilometers:4

Distance in meter=4000.00000

Distance in centimeter=400000.0000

Distance in feet=13123.359375

Distance in inches =157480.312500

1) calculate the simple interest  program click the link-- ---https://allcodescience.blogspot.com/2021/12/calculate-of-simple-

interest.html

 2 .Ramesh basic salary is input through the keyword .His dearness allowance is 40% of the basic salary and house rent allowance is 20% of basic salary write a program to calculate his gross salary.  click the link---- 

 



3.How will learn of c language?---

click the link   https://allcodescience.blogspot.com/2021/12/how-learn-of-c-language.html

 

Comments

Popular posts from this blog

class with array in c++ (memory allocatin & using array in classes)

constructor with default arguments

constructor overloading in c++ programming