Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write a C program to find sum of first and last digit of a number.
- #include<stdio.h>
- int main(){
- int x,FN,LN;
- printf("Enter a Number :");
- scanf("%d",&x);
- LN=x%10;
- while(x>10){
- x=x/10;
- FN=x;
- }
- printf("Sum of First and last Digit Is :%d\n",FN+LN);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment