Computer Science, asked by daulatali24123, 4 months ago

Q8. Write a program to check whether the number is greater than 10 or not.​

Answers

Answered by lilidey81
0

Explanation:

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

Similar questions