बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

Showing posts with label c Program to cyclically permute the elements of array. Show all posts
Showing posts with label c Program to cyclically permute the elements of array. Show all posts

Program to cyclically permute the elements of array

c Program to cyclically permute the elements of array 



#include <stdio.h>
 int 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]); return 0; }

OUTPUT:-
---------------------------------

 Enter the value of the n = 5 Enter the numbers 1 2 3 4 5 Cyclically permuted numbers are given below 2 3 4 5 1
--------------------------------



C Program example List