Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int n;
- printf("Enter the number:\n");
- scanf("%d", &n);
- int last = n % 10;
- int first = 0;
- while (n > 0) {
- first = n % 10;
- n /= 10;
- }
- printf("First and last numbers are: %d %d\n", first, last);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement