Skip to content

Instantly share code, notes, and snippets.

@qassa
Created September 29, 2013 11:19
Show Gist options
  • Save qassa/6751598 to your computer and use it in GitHub Desktop.
Save qassa/6751598 to your computer and use it in GitHub Desktop.
//выводит положительные числа, отрицательные заменяет нулями, нули не трогает
#include<conio.h>
#include<stdio.h>
void func (int a[],int SIZE){
int i=0;
for(;i<SIZE;i++){
if(a[i]<0)
a[i]=0;
printf("%d\n",a[i]);
}
}
int main (){
int const size=9;
int a[size]={5,-1,0,96,-50,100,-8,-9,-2};
func(a,size);
getch();
return 0;
}
//выводит положительные числа, отрицательные заменяет нулями, нули не трогает
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment