Last active
September 25, 2018 10:56
-
-
Save mehmeteminkartal/89dbb4362778e21ded6bf8ff21932f2c to your computer and use it in GitHub Desktop.
Creates squares with '*' characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// cchalenge | |
// | |
// Created by Mehmet emin Kartal on 11/17/16. | |
// Copyright © 2016 mehmet. All rights reserved. | |
// | |
#include <stdio.h> | |
int main(int argc, const char * argv[]) { | |
int side = 10; | |
for (int i = 0; i < side*side ; i++) { | |
printf((i % side == 0 || i % side == (side - 1) || i < side || i > ((side*side)-side)) ? ((i % side == (side-1)) ? "*\n" : "*") : " "); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment