Run Code
|
API
|
Code Wall
|
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
18BCE2182 ASSESS_1 Q2-1
18BCE2182 LAB FAT-2(A)-(i)
150115_EsMatrizOrdenada
PuntosTriangulo
18BCE2182 ASSESS_2 Q1
muuchas funciones utiles
swapping using call by reference
joseph triangle
array and its sum
Project v0.07