C program to cyclically permute the array 


#include <stdio.h>
void main ()
{
 int i,n,number[30];
 printf("Enter the value of the n = ");
 scanf ("%d", &n);
 printf ("Enter the numbers\n");
 for (i=0; i<n; ++i)
 {
  scanf ("%d", &number[i]);
 }
 number[n] = number[0];
 for (i=0; i<n; ++i)
 {
  number[i] = number[i+1];
 }
 printf ("Cyclically permted numbers are given below \n");
 for (i=0; i<n; ++i)
 printf ("%d\n", number[i]);
}


Output:

C prgogramming, c programs, array

06 Aug 2015

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

 
Top