alright my program needs to prompt the user how many circles between 1 and 10 they would like to calculate circumference and area of. then the user enters a number between 1 and 10 or the program prints an error message.
however, if a correct number is entered, it then begins to prompt the user to enter the radius for each circle and stores them in an array to do the required calculations.
lets say you want to use 4 circles.
the problem is that its printing the prompt message:
"Enter the radius for circle #1:"
"Enter the radius for circle #2"
"Enter the radius for circle #3:"
"Enter the radius for circle #4:"
*then down here it allows you to enter the radius'*
i need it to prompt like this:
"Enter the radius for circle #1:"
(scans your entry)
"Enter the radius for circle #2:"
(scans your entry)
"Enter the radius for circle #3:"
(scans your entry)
"Enter the radius for circle #4:"
(scans your entry)
any ideas?
*please keep in mind im working on this and its not nearly completed yet, i just like to compile and test along the way so i dont get a million errors at the end to deal with.
Code:
#include <stdio.h>
main ()
{
int circleno;
int imputvalues[10], i;
int j;
printf("Please enter the number of circles (max = 10):\n");
scanf("%i", &circleno);
if (circleno < 1 || circleno > 10)
printf("Error -> %i circles is too many. Please try again:\n", circleno);
else
printf("You have selected to enter %i circles.\n\n", circleno);
for ( j = 1; j <= circleno; ++j )
printf("Enter the radius for circle #%i:\n\n", j);
scanf("%i", &imputvalues[i]);
return 0;
}
i appreciate the help guys and gals!