View Code of Problem 79

#include <stdio.h>
int main()
{
	int n,m,a[10];
  	scanf("%d",&n);
  	for(i=0;i<n;++i)
          scanf("%d",&a[i]);
  	scanf("%d",&m);
  	for(i=n-m;i<n;++i)
          printf("%d ",a[i]);
  	for(i=0;i<n-m-1;++i)
          printf("%d "a[i]);
  	printf("%d",a[n-m-1]);
  	
  	




}
/*
Main.c: In function 'main':
Main.c:6:8: error: 'i' undeclared (first use in this function)
    for(i=0;i<n;++i)
        ^
Main.c:6:8: note: each undeclared identifier is reported only once for each function it appears in
Main.c:12:23: error: expected ')' before 'a'
           printf("%d "a[i]);
                       ^
Main.c:12:23: warning: format '%d' expects a matching 'int' argument [-Wformat=]
*/

Double click to view unformatted code.


Back to problem 79