Advertisement
Hafizur

3.

Jun 20th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n,first,last,sum;
  5.     printf("Enter A number:");
  6.     scanf("%d",&n);
  7.     last=n%10;
  8.  
  9.     while(n>=10)
  10.     {
  11.         n=n/10;
  12.     }
  13.     first=n;
  14.     sum=first+last;
  15.     printf("Sum Of First Digit And Second Digit = %d\n",sum);
  16.    
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement