Documente Academic
Documente Profesional
Documente Cultură
com
Table of Content
to-access-address-of-variable.html)
accessing-value-from-address-in.html)
area-of-circle-using.html)
programs.html)
elements.html)
language.html)
C Program to Delete an element from the specied location from Array (http://www.c4learn.com/c-
programs/program-for-deletion-of-element-from.html)
element-in-array.html)
programs/copy-all-elements-of-array-into-another.html)
array.html)
two-arrays-in-c-programming.html)
programs/reversing-of-array-elements-in-c.html)
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 1/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
programs/nd-largest-element-in-array-in-c.html)
programs/nd-smallest-element-in-array-in-c.html)
of-all-elements-in-array.html)
duplicate-elements-in-array.html)
numbers-using-pointer.html)
C Program to Read integers into an array and Reversing them using Pointers
to-nd-length-of-the-string-using-pointer.html)
(http://www.c4learn.com/c-
to-implement-stack-operations-using-array.html)
programs/)
C Program to Count number of words,digits,vowels using pointers (http://www.c4learn.com/c-
programs/c-program-to-count-number-of-wordsdigitsvowels-using-pointers-in-c-programming.html)
programs/c-program-to-compute-sum-of-the-array-elements-using-pointers.html)
program-to-perform-stack-operations-using-pointer.html)
programs/interchanging-values-of-two-variables.html)
binary-search-array-using-recursion.html)
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 2/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
PlayRummy&WinBIG
Replay
GET
Iwon
1500
IwonaniPadina
80,000in
IwonaGoaTripby
WelcomeBonus
RummyTournament
RummyContest!
playingRummy
PlayRummyNow
ChandraMouli
LakshmiKala
RamaChandra
Kasargod,Kerala
Vadakara,Kerala
Hyderabad,AP
T&C
Write a C program using pointers to read in an array of integers and print its
elements in reverse order.
#include<stdio.h>
#include<conio.h>
#define MAX 30
(http://www.c4learn.com/c-
void main() {
programs/)
int size, i, arr[MAX]
int *ptr
clrscr()
ptr = &arr[0]
printf("\nEnter the size of array : ")
scanf("%d", &size)
printf("\nEnter %d integers into array: ", size)
for (i = 0 i < size i++) {
scanf("%d", ptr)
ptr++
}
ptr = &arr[size - 1]
printf("\nElements of array in reverse order are :")
for (i = size - 1 i >= 0 i--) {
printf("\nElement%d is %d : ", i, *ptr)
ptr--
}
getch()
}
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 3/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
Output :
Program to read integers into an array and reversing them using pointers
Explanation :
int size,i,arr[MAX]
int *ptr
(http://www.c4learn.com/c-
ptr=&arr[0]
programs/)
3. Accept Size of an Array.
4. Now we have accepted element one by one using for loop and scanf statement .
6. After accepting all elements store address of last element inside pointer variable.
ptr=&arr[size-1]
7. Again using reverse for loop and printf statement print an array.
for(i=size-1i>=0i--) {
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 4/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
printf("nElement%d is %d :",i,*ptr)
ptr--
}
SponsoredLinks
BaracksWorstNightmare!MaliaObamaCaughtPARTYINGInAmsterdam
RadarOnline
(http://www.c4learn.com/c-
programs/)
BeaRummySuperstarNow!BeaRummySuperstarToday
JungleeRummy
RenewyourCarInsuranceIn3EasySteps.
QuickBima.com
Calculate:AreYouFinanciallyProtectedAgainstHospitalBills?
BigDecisions
4ReasonsYouArePayingTooMuchforCarInsurance
Coverfox
IndepthStockMarketNewsForYou
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 5/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
2Comments www.c4learn.com
1 Login
Jointhediscussion
qasim2yearsago
awesome
Reply Share
paventhan2yearsago
fantastic
Reply Share
(http://www.c4learn.com/c-
programs/)
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 6/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
(http://www.c4learn.com/c-
programs/)
ProgrammingTutor...
LikePage 42klikes
Bethefirstofyourfriendstolikethis
Get in Touch!
Recent Programs
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 7/8
9/26/2016 CProgramtoReadintegersintoanarrayandReversingthemusingPointers1DArrayPrograms,PointerProgramsc4learn.com
arithmetic-operations-on-oat.html)
(http://www.c4learn.com/c-
programs/)
http://www.c4learn.com/cprograms/cprogramusingpointersreadarrayofintegersandreverseit.html 8/8