While Loop Condition in C
if (stock_choice == 'A'){
int positive = 0;
while (positive = 0){
printf("You Have Chosen ANNUAL, Please Enter the Amount of
Stock available: ");
scanf("%lf",&stock[0][1]);
if (stock[0][1] < 0){
printf("Stock Amount Must be Positive! Try Again.");
}
else{
positive = 1;
}
}
printf("Enter the Average Price of ANNUALs: ");
scanf("%lf",&stock[0][2]);
printf("Enter the percent Markup of ANNUALs: ");
scanf("%lf",&stock[0][3]);
printf("\nThe Amount of ANNUAL = %lf, AVG_Price = %lf, Markup =
%lf ",stock[0][1],stock[0][2],stock[0][3]);
}
I am having trouble with a while loop condition, i have tried everything
and cannot understand why the while loop does not run. Am I not see
something here or whats wrong?
No comments:
Post a Comment