#include<stdio.h>
float conversion1(float number)
{
return number*100;// conversion metre to cm
}
float conversion2(float number)
{
return number*74.93; // conversion usd to rupees
}
int main()
{
int num;
float num1,num2;
char metre,cm,usd,rupees,kg,pounds;
printf("Enter 1 for conversion metre to cm\n");
printf("Enter 2 for conversion usd to rupees\n");
scanf("%d",&num);
if (num==1)
{
printf("Enter the number you want conversion of:-\n");
scanf("%f",&num1);
printf("%f metre=%f cm\n",num1,conversion1(num1));
}
if (num==2)
{
printf("Enter the number you want conversion of:-\n");
scanf("%f",&num2);
printf("%f usd=%f rupees\n",num2,conversion2(num2));
}
return 0;
}
Comments
Post a Comment