Created
September 29, 2013 11:19
-
-
Save qassa/6751598 to your computer and use it in GitHub Desktop.
//выводит положительные числа, отрицательные заменяет нулями, нули не трогает
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<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