Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int sum=0,n,fd,ld;
- scanf("%d",&n);
- ld=n%10;
- while(n>=10)
- {
- n=n/10;
- }
- fd=n;
- sum=fd+ld;
- printf("first and last digit sum=%d",sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement