How to loop for wrong input

Just new to C and I'm trying to make a basic calculator. I'm trying to figure out how to make a loop such that the program will run after failing due to incorrect user input. So far, this is what I came up with, and I just want to know how I can get the program to actually run the operations when entering a correct sign after getting a "try again" message.

#include <stdio.h>

float addition(float num1, float num2)
{
return num1 + num2;
}

float subtraction(float num1, float num2)
{
return num1 - num2;
}

float multiplication(float num1, float num2)
{
return num1 * num2;
}

float division(float num1, float num2)
{
return num1 / num2;
}

int main()
{
float firstNum, secondNum;
char operationSign;
float answer;

printf("Basic Calculator\n\n");

printf("Enter the first number: ");
scanf("%f", &firstNum);

printf("Enter the second number: ");
scanf("%f", &secondNum);

printf("Enter the operation symbol to be used:\n");
printf("Addition:                            +\n");
printf("Subtraction:                         -\n");
printf("Multiplication:                      *\n");
printf("Division:                            /\n");
scanf(" %c", &operationSign);

switch (operationSign)
{
case ('+'):
answer = addition(firstNum, secondNum);
printf("Answer: %f", answer);
break;

case ('-'):
answer = subtraction(firstNum, secondNum);
printf("Answer: %f", answer);
break;

case ('*'):
answer = multiplication(firstNum, secondNum);
printf("Answer: %f", answer);
break;

case ('/'):
answer = division(firstNum, secondNum);
printf("Answer: %f", answer);
break;

default:
printf("Invalid input. Please enter the correct symbol.");
scanf(" %c", &operationSign);
}

return 0;
}
reddit.com
u/erojerisiz — 2 days ago

Looking for: Motorcycle street racer

There seems to be a particular lack of motorcycle street racers, and the closest thing I got to what I want is Midnight Club 3 and even then, that's a car game that just happens to have bikes. In fact, they only have like 14 bikes at most, and they were only choppers and sport bikes.

I was wondering if there are any motorcycle-based street racing games out there on steam that have lots of variation in bike types and customization, preferably with a mid-2000s vibe. 10

reddit.com
u/erojerisiz — 12 days ago

[Linux] Save file directory

I'm trying to set up ppsspp on cachyos, but I can't find the file directory for the save data. I've heard about the linux version using the xdg file directory, but I don't know how to find let alone access the folders themselves. I also tried the show memory stick folder in settings, but nothing happens with it.

Is there a way to redirect the file directory to a new folder?

reddit.com
u/erojerisiz — 1 month ago