Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ program to reverse an array

#include<iostream>
using namespace std;
int main()
{
   int a[]={1,2,3,4,5};  // Using Pointer and Array Relationship
    for (int i = 4; i>=0; i--)
    cout<<*(a+i);
   return 0;
}
 
PREVIOUS NEXT
Tagged: #program #reverse #array
ADD COMMENT
Topic
Name
8+1 =