#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 permuted numbers are given below \n”);
for (i=0; i<n; ++i)
printf (“%d\n”, number[i]);
}
/*————————————-
Output
Enter the value of the n = 5
Enter the numbers
10
30
20
45
18
Cyclically permuted numbers are given below
30
20
45
18
10
—————————————————*/
Not Satisfied ? Just search & get the result
Related posts:
- C Program to accept N integer number and store them in an array AR. The odd elements in the AR are copied into OAR and other elements are copied into EAR. Display the contents of OAR and EAR
- C program to read N integers and store them in an array A, and so find the sum of all these elements using pointer. Output the given array and and the computed sum with suitable heading
- C program to sort given N elements using SELECTION sort method using functions a) To find maximum of elements b) To swap two elements
- C program to read in four integer numbers into an array and find the average of largest two of the given numbers without sorting the array. The program should output the given four numbers and the average with suitable headings.
- C program to read a matrix A (MxN) and to find the following using functions a) Sum of the elements of each row b) Sum of the elements of each column c) Find the sum of all the elements of the matrix Output the computed results with suitable headings
