/*Help me finished this code.I trying to make a program that will ask 2 choices. 1 is for converting dollars to peso and 2 is for converiting peso to dollars. Im trying my best but i dont seem to get the right code for it. Im just a beginner in C Language. Its kinda confusing using if statements i dont even know how to make a condition for it. I know there a lot of talented programmers and coders here i kinda nid ur help.*/
#include <stdio.h>
int main ()
{
float dollar,peso,dollar2,peso2,dtotal,ptotal,;
int choice;
printf("Enter 1 if you want to convert dollars to peso");
printf("\nEnter 2 if you want to convert peso to dollars\n");
printf("Enter your choice: ");
scanf("%d",&choice);
getchar();
if (choice == 1)
{
printf("Enter the amount of dollar(s): ");
scanf("%.2f" ,&dollar);
getchar();
printf("%.2f dollar(s) is equivalent to %.2f peso(s)",dollar,dollar*(1/48));
}
getchar();
if (choice != 1)
{
printf("Enter the amount of peso(s): ");
scanf("f",&peso2);
dtotal=peso2*48;
printf("%f peso(s) is equivalent to %f dollar(s)",peso2, dtotal);
}
getchar();
return 0;
}