/* title: hollowSquareOfAsterisk author: aeriqusyairi date: dec27 2011 */ #include<stdio.h> #include<stdlib.h> int main(){ int side=0,c1=1,c2=1,c3=0; printf("Input the side of your square: "); scanf("%d", &side); for(c1=1;c1 <= side;c1++){ if(c1 == 1 || c1 == side){ for(c2=1;c2 <= side;c2++){ printf("*"); } printf("\n"); }else{ for(c2=1;c2 <= side;c2++){ if(c2 == 1 || c2 == side) printf("*"); else{ printf(" "); } } printf("\n"); } } system("pause"); return 0; }
My C Repository
C How to Program
Sweet thanks to my broski Yusuke Fiz for this Deitel book.
You light up my life dude.
Just another personal public repository.
Wednesday, March 14, 2012
Hollow Square of Asterisks
Similar to Square of Asterisk except it print a hollow square out of asterisk with respect to the side being reads.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment