Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save OwiseKyawMinOo/56a284941ec7224a5db364591887ce7a to your computer and use it in GitHub Desktop.
Save OwiseKyawMinOo/56a284941ec7224a5db364591887ce7a to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<conio.h>
#define arraysize 100//maximum array size
void negarr(void);//functiondeclare prototype
int main()
{
int arr[arraysize];//declare arraysize
int i,j;
int array[10]={34,-3,4,56,7,-1,0,5,-23,-77};
negarr();//function call
printf("Ente size of array");//input size
scanf("%d",&j);
//input element int the array
printf("Enter element in array : ");
for(i=0;i<j;i++)
{
scanf("%d",&arr[i]);
}
printf("\n All negetive element array ");
for(i=0;i<j;i++)
{
if(arr[i]<0)
{
printf("%d\t",arr[i]);
}
}
}
void negarr(void)//function definition
{
int array[10]={34,-3,4,56,7,-1,0,5,-23,-77};
printf("negative value :");
for(int i=0;i<10;i++)
{
if(array[i]<0)
{
printf("%d",array[i]);
}
}
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment