Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // s1mple prog that takes a "abcd" int from a user and prints a\n b\n c\n d\n
- //9581 is used for testing
- #include <stdio.h>
- int num, a ,b ,c ,d;
- int main() {
- printf("Enter your 4 digit intger");
- scanf("%d", &num);
- a = num / 1000;
- printf("%d\n", a);
- b = num / 100;
- b = b % 10;
- printf("%d\n", b);
- c = num / 10;
- c = c % 10;
- printf("%d\n", c);
- d = num % 10;
- printf ("%d", d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement