I'm trying to write a program with several functions in it. Unfortunately i haven't gotten past the first function. The question is:
Write a function that receives an array of integers >= in parameter and return a compacted version of the array containing only the values > 0.
Below is what i have, it looks bad i know, but its a working progress, any help would be appreciated.
#include<stdio.h>
#include<math.h>
#define SIZE 81
void array_easy( int a[]);
int main(){
int value[SIZE] = {5,6,3,4,0,0,1,2};
array_easy(value);
return 0;
}
void array_easy(int a[]){
int i;
int hold =0;
for(i=0; i < SIZE; i++){
if(i <= 0){
i =+ hold;
}}
printf("\nThis is the array with numbers greater than zero\n");
for(i=0; i < SIZE; i++){
printf("%d",a);
}
printf("\n");
//return a;
}
Write a function that receives an array of integers >= in parameter and return a compacted version of the array containing only the values > 0.
Below is what i have, it looks bad i know, but its a working progress, any help would be appreciated.
#include<stdio.h>
#include<math.h>
#define SIZE 81
void array_easy( int a[]);
int main(){
int value[SIZE] = {5,6,3,4,0,0,1,2};
array_easy(value);
return 0;
}
void array_easy(int a[]){
int i;
int hold =0;
for(i=0; i < SIZE; i++){
if(i <= 0){
i =+ hold;
}}
printf("\nThis is the array with numbers greater than zero\n");
for(i=0; i < SIZE; i++){
printf("%d",a);
}
printf("\n");
//return a;
}