Created
September 10, 2014 20:19
-
-
Save fredrb/0bf2d40c4ef6ea5d2040 to your computer and use it in GitHub Desktop.
sort.c
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
#include<stdio.h> | |
#include<stdlib.h> | |
void print_array( int *arr , int size ); | |
int main() { | |
int a[10] = { 2, 7, 3, 4, 5, 6, 1, 8, 9, 10 }; | |
print_array(a, sizeof(a) / sizeof(int)); | |
return 0; | |
} | |
void print_array( int *arr, int size ){ | |
int i, j; | |
for( i = 0 ; i < size ; i++){ | |
printf("Pos %i = \t", i); | |
for( j = 0 ; j < arr[i] ; j++){ | |
printf("*"); | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment