I can not cope with the task of programming. There is a task: to write a program so that it displays a hollow square. Use only while.
#include <stdio.h> #include <stdlib.h> main() { int a = 0; printf("Please input side a"); scanf("%d", &a); int count = 1; while (count <= a) { printf("*"); count++; } printf("n"); int count2 = 1; while (count2 <= (a - 2)) { a // ???????? count2++; } int count3 = 1; while (count <= a) { printf("*"); count3++; } system("PAUSE"); }
I understood how to make a full square be displayed, but with a hollow one it does not work, I can not understand more precisely how to put *
and at the end *
, and in the middle there are spaces.