#include <stdio.h>
int main() {
int n,i=0,j=1,k,digit[100],temp;
scanf("%d",&n);
temp=n;
while(temp!=0){
int r = temp%10;
digit[i++]=r;
temp=temp/10;
}
printf("after swaping: ");
//printing last digit at first;
printf("%d",digit[0]);
//printing midle digit.
for(j=i-2; j>0; j--)
{
printf("%d",digit[j]);
}
//printing first digit at last
printf("%d",digit[i-1]);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: