View Code of Problem 54

#include<stdio.h>
int main(){
  int a[20];
  int m,i;
  int n=0;
  scanf("%d",&m);
  while(m!=0){
  a[n]=m%10;
  m=m/10;
    n++;
  }

  for(i=n-1;i>=1;i--){
    printf("%d ",a[i]);
    }
  printf("%d",a[0]);
}

Double click to view unformatted code.


Back to problem 54