ProAnswers.org

Write a C program to display array elements in reverse order?

#include

#include 

void main() 

{ 

int show(int*); 

int num[]={12,13,14,15,16,17,18} 

clrscr(); 

show(&num[6]); 

} 

Show(int*u) 

{ 

Int m=6; 

while(m!=-1) 

{ 

printf(ā€œ

num[%d]=%dā€,m,*u);

u--, m--; 

} 

return (NULL); 

getch(); 

} 

Output: 

Num[6]=18 

Num[5]=17 

Num[4]=16 

Num[3]=15 

Num[3]=14 

Num[1]=13 

Num[0]=12