#include<stdio.h>
int main()
{
int jum;
printf("Masukan batasan Array: ");
scanf("%d",&jum);
int array[jum];
for (int i=0; i<jum; i++)
{
printf("Masukan Nilai Array: ");
scanf("%d",&array[i]);
}
printf("Array: \n");
for (int i=0; i<jum; i++)
{
printf("%i ",array[i]);
}
int tmp=array[jum-1];
for (int i=jum-1; i>0; i--)
{
array[i]=array[i-1];
}
array[0]=tmp;
printf("\nArray saat ini: \n");
for (int i=0; i<jum; i++)
{
printf("%i ",array[i]);
}
}
Program Menggeser ke kiri
Labels:
Disain Analisis Algoritma
0 comments:
Post a Comment