تحويل من كيلو جرام الى باوند, ومن باوند الى كيلو جرام
#include
int main()
{
//Write a C program to convert kilograms to pound, and vise versa.
//Formula for conversion kg to pounds:
//1 kilogram = 2.20462262184878 pounds
//Hence, pounds = 2.2 * kilograms
int choice;
float kg,pound;
printf("welcome, what do you want to do?\npress 1 to converto kilograms to pounds\npress 2 to convert pounds to kilograms:");
scanf("%d",&choice);
if(choice==1)
{
printf("Enter value of Kilograms : ");
scanf("%f",&kg);
pound=2.20462262184878*kg;
printf("\n\t-- Convert Kilograms to pounds --\n");
printf("\n%f kg = %f pound",kg,pound);
}
else{
printf("Enter value of pounds : ");
scanf("%f",£);
kg=pound/2.20462262184878;
printf("\n\t-- Convert pounds to Kilograms--\n");
printf("\n%f pounds = %f kg",pound,kg);
}
getch();
return 0;
}