Ok I made this converter for my friend so that he can see how much things are in Canadian money compared to American money and it works, but what I would like to do is have it so it keeps looping untill someone enters a value lower than 1, and if they do it exits. This is what I have so far:
I had originally thought of puttin a break command in the else part of if else, but that is not allowed, and I couldn't think of a way to do it with a do or for statement without it repeating over and over again, can someone help and thanks.Code:#include <stdio.h> float userNum=0; float userNumA=0; #define US 1.57551; int main(void) { printf("This is a currency converter, from American dollars to Canadian\n"); printf("Please enter the american amount now: "); scanf("%f", &userNum); if(userNum>=1) { userNumA =userNum * US; printf("American amount:%f Canadian amount: %f\n\n",userNum, userNumA); } else { printf("Thank you for using my converter\n\n"); } return 0; }