So far I have my code down to this. The second outer for loop seems to be the problem. I cant get it to print properly. any ideas?
Code:
#include<stdio.h>
int main(void)
{
//RectangleSize represents the area of the rectangle(width*length)
int length, width, RectangleSize;
printf("Enter an integer for length:");
scanf("%d", &length);
printf("Enter an integer for width:");
scanf("%d", &width);
RectangleSize = length*width;
printf("The area of your rectangle is: %d\n", RectangleSize);
printf("%d in decimal\n", RectangleSize);
printf("%x in hexadecimal\n", RectangleSize);
printf("%o in octal\n", RectangleSize);
//for loops used to print a rectangle
int x, y;
for(x=1; x<=width; x++)
{
printf("*");
}
for(x=0; x<=length-2; x++)
{
y=0;
for(;y==0; y++)
{
printf("*");
}
for(;y<=width-2; y++)
{
printf(" ");
}
for(;y==width;)
{
printf("*\n");
}
}
/* for(x=1; x<=width; x++)
{
printf("*");
}
*/
return 0;
}