Online Compiler C

#include <stdio.h> int main() { int A[10]; for (int i = 0; i < 10; i++) { scanf("%d", &A[i]); } int last = A[9]; for (int i = 8; i >= 0; i--) { A[i + 1] = A[i]; } A[0] = last; for (int i = 0; i < 0; i++) { printf("%d", A[i]); } return 0; }
This code reads 10 integers into an array, then shifts all elements one position to the right, moving the last element to the first position. Finally, it attempts to print the array.

- The loop that prints the array uses the condition `i < 0`, which means it will never execute because `i` starts at 0 and 0 is not less than 0. The printed output will be empty.
- The shifting logic correctly moves each element to the next index, but after the shift, the original last element is placed at the beginning. Check if the final array order matches what you intended.