Created
March 7, 2022 09:03
-
-
Save naemazam/9c7a760af016720598bc563d921390e6 to your computer and use it in GitHub Desktop.
declare an array to save 10 integers output all the negative numbers
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
/* C Program to Print Negative Numbers in an Array */ | |
#include<stdio.h> | |
int main() | |
{ | |
int Size, i, a[10]; | |
Size = 10; | |
printf("\n Please Enter the Array Elements : "); | |
for(i = 0; i < Size; i++) | |
{ | |
scanf("%d", &a[i]); | |
} | |
printf("\n List of Negative Numbers in this Array : "); | |
for(i = 0; i < Size; i ++) | |
{ | |
if(a[i] < 0) | |
{ | |
printf("%d ", a[i]); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment