Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include<string.h>
- #include <stdlib.h>
- #include <time.h>
- void Swap(int n) {
- int a,length;
- char str[20];
- char temp1[1];
- char temp2[1];
- sprintf(str, "%d", n);
- length = strlen(str)-1;
- temp1[0] = str[0];
- temp2[0] = str[length];
- str[length] = temp1[0];
- str[0] = temp2[0];
- printf("\n%s\n",str);
- }
- int main()
- {
- int i,lower,upper;
- lower = 90;
- upper = 9999;
- for (i = 0; i < 5; i++) {
- int rand_num = (rand() % (upper - lower + 1)) + lower;
- printf("\n%d\n ", rand_num);
- Swap(rand_num);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement