I'm just trying to get this program to take a number between 1 and 9 and calculate the radius and display it. This program is supposed to loop but all I'm getting is the "Thank you for using the software!" print function, it's not going through the loop at all and I can't seem to understand why.
#include <stdio.h> int main(void){ float i,r, V; for(i=0; i <= 4; i++){ while ( r != 0) { printf("Enter a radius between 1 and 9: \n"); scanf ("%f", &r); V= (3.141592)*r*r*10; if (r>=1 && r<=9){ printf("The cylinder volume is %f\n", V); } else if (r > 9 || r < 0){ printf ("The input is out of the acceptable range. Select an integer less than $/n"); } printf("Thank you for using the software!\n"); } return 0; }