What I'm trying to achieve is to not allow the denominator to be 0. So I am trying to make the denominator default to 1 if I was to enter 0 for the it. I need help with my if else statement, on my compiler it keeps saying "expected ';' before else". Also the if statement won't run correctly even if I took out "else".
Thanks a bunch in advance.
1 2 3 4 5 6 7 8
printf(" Enter the stock ticker... ");
scanf("%s",&Ticker[0]);
printf(" Enter the price of %s: ");
scanf(" %d %d/%d",&whole,&num,&dem);
if (dem == 0);
{"%d",&dem = 1;}
else
{pricePerShare = whole + (float)num/dem;}