/* title: DisplayingASquareOfAnyCharacter author: aeriqusyairi date: Jan23 2012 */ #include<stdio.h> void displaySquare(char, int); int main(){ int side = 0; char qwerty; printf("Input side:"); scanf("%d", &side); printf("Input character:"); scanf(" %c", &qwerty); displaySquare(qwerty, side); system("pause"); return 0; } void displaySquare(char fillCharacter, int theSide){ int i, j; for(i = 1; i <= theSide; i++){ for(j = 1; j <= theSide; j++){ printf("%c", fillCharacter); } printf("\n"); } }
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.
Thursday, March 15, 2012
Displaying a Square of Any Character
Input the side and your desired character and this program will print your desired square out of the character being input.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment