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.
Simple Calculator v1.0
orange blue bell Einstein's piece chastitise then
c program for hollow rhombus
Serie de Fibonacci
strcat
My first array
ATM
20161118_ArrayRepetidos
bitmask shift
B_141104_NotaInterroganteDosPuntos
Please log in to post a comment.