for(x=0; x<=2; x++)
x=0 0<=2 TRUE x=1 1<=2 TRUE x=2 2<=2 TRUE x=3 3<=2 FALSE
#include<iostream.h> main() { int a[15]={5,10,15,20,25}; int x,temp,size; size 5; for(x=0; x<=size/2; x++) { temp=a[x]; a[x]=a[((size-1)-x)]; a[((size-1)-x)]=temp; } for(x=0; x<=4; x++) { cout<<" ELEMENT "<<x<<a[x]; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)