Question: 3. Problem-3 (10 points). When executed, the following C program prints out a solid square of *, for example, if we enter 4, the program

3. Problem-3 (10 points). When executed, the following C program prints out a solid square of *, for example, if we enter 4, the program prints: **** **** **** **** Modify the given program below so it prints just the perimeter of the square, that is, for the same input 4, now the program should print out: **** * * * * ****

Here is the code: #include int main() { int size; printf("Enter square size "); scanf("%d", &size); getchar(); for(int i = 0; i < size; i++) { for(int j = 0; j < size; j++) { printf("*"); } printf(" "); } return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!