Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CreverseInt
//gcc 7.4.0 //print an array of integers in reverse order using pointer //code is created by Rezaul Hoque on May 27 ,2021 //contact at jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <stdio.h> struct integer{ int num; }; int main() { struct integer a[5]={{1},{2},{3},{4},{5}};//a contains 5 struct integer elements struct integer * point = NULL; //a pointer of struct integer type //print the array printf("\nIntegers:\n"); //point indicates the first element of the array a; as long as it is less 5, print array element and increment point for (point= a;point<a+5;point ++) printf("%d\t",point->num); //print the reversed array printf("\nReversed integers:\n"); point = a+4;//point indicates the last element of the array while(point >=0)//as long as point is greater than or equal to 0(index of first element of the array), print array and decrement point { printf("%d\t",point->num); point--; } return 0; }
run
|
edit
|
history
|
help
0
2.1.2 Sum of all the elements in a one dimensional array A using reduction.
recurs fibo1
Witout goto
C_141126_ArrayMayorMenor02
pruebapi2
B_141205_funciones
test
1
B_141111_Divisores
DDD