Tuesday, 17 June 2025

C Programming Solved Problems Let us C Yashwant Kanitkar Chapter 1

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


/*Q: (b) The distance between two cities (in km.) is input through the keyboard.

Write a program to convert and print this distance in meters, feet, inches and centimeters.*/

#include<stdio.h>

#include<conio.h>

void main()

{

double dkm,dm,dcm,dft,din;

clrscr();

printf("Enter Distance in KM");

scanf("%lf",&dkm);

dm=dkm*1000;

dcm=dm*100;

din=dcm*0.3937;

dft=dcm*0.0328;

printf("Distance in CM = %lf\n",dcm);

printf("Distance in Inches = %lf\n",din);

printf("Distance in Feet = %lf\n",dft);

printf("Distance in Meter = %lf",dm);

getch();

}









Download Source Code


Page : 1 2 3 4


No comments:

Post a Comment