Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
print_odd_pointer.c
//gcc 5.4.0 #include <stdio.h> void print_odd(int n, int arr[]) { int *p; int flag = 1; p = &arr[0]; for (int i = 0;i < n;i++) { if (*(p+i)%2 != 0) { printf("%d\n",*(p+i)); flag = 0; } } if (flag) printf("-1"); } int main(void) { int n = 5; int arr[5] = {2,2,2,2,2}; print_odd(n,arr); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
1
Bitwise Operations
recursive
TopRightTriangle.c
print_odd_pointer.c
Ad
Majeur ou mineur
problemapi2
20161118_ArrayRepetidos
ChangeStructVal
Please log in to post a comment.