Search This Blog

Translate

C program to reverse the array element

 C program to reverse the array element


#include
#include
void main()
{
 int n[10],i,j,temp=0,temp1=0,k;
 clrscr();
 for(i=0;i<4 br="" i=""> {
  printf("\n Enter the  %d element:",i);
  scanf("%d",&n[i]);
  }


  for(i=0,k=1,j=4;i<9 br="" i="" j--="" k="">  {
      temp=n[i];
      n[i]=n[j];
      temp1=n[k];
      n[k]=temp;

  }
  for(i=0;i<4 br="" i="">  printf("\n The array elements after reverse are:%d",n[i]);

 getch();
}

C Program example List

Google+ Badge