Check if sum of digits is greater than 10 - C Program

C program to read a number and check if it is two digit number or not. If yes, then check if sum of its digit is greater than 10 or not.

Solution:

#include<stdio.h>
int main()
{
     int num,f,l,sum;
     printf("Enter Any Two Digit Number : ");
     scanf("%d",&num);
     if(num>9 && num<100) // Condition to check two digit number
     {
          printf("\n%d is Two Digit Number.\n",num);
          f=num%10; // to find unit place digit
          l=num/10; // to find 10 place digit
          sum=f+l; // sum of both digit
          printf("Sum of Digits = %d\n",sum);
          if(sum>10) //inner if, check sum is greater than 10 or not
          {
               printf("Sum is Greater Than 10");
          }
          else
          {
               printf("Sum is Less Than 10");
          }
     }
     else
     {
          printf("%d is Not a Two Digit Number.",num);
     }
     return 0;
}


Output:

sum digit greater ten