Skip to content

Commit 06c3802

Browse files
Create Delete_all_the_odd_numbers.c
1 parent b234483 commit 06c3802

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Delete_all_the_odd_numbers.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <stdio.h>
2+
#include <string.h>
3+
#include <math.h>
4+
#include <stdlib.h>
5+
6+
int main() {
7+
8+
int n,count=0;
9+
scanf("%d",&n);
10+
int a[n];
11+
for(int i=0;i<n;i++)
12+
{
13+
scanf("%d",&a[i]);
14+
if(a[i]%2==0){
15+
count++;
16+
}
17+
}
18+
int arr[count],j=0;
19+
for(int i=0;i<n;i++){
20+
if(a[i]%2==0){
21+
arr[j]=a[i];
22+
j++;
23+
}
24+
}
25+
for(int j=0;j<count;j++){
26+
printf("%d ",arr[j]);
27+
}
28+
return 0;
29+
}

0 commit comments

Comments
 (0)