What is this code answer
Byang is learning how to add numbers. However, he gets confused whenever there is a carry.
To help Byang you need to write a program that will read two integers and determine if Byang will encounter any carry when adding these two numbers.What this problem code?
Please,give me this answer
#include <stdio.h>
int main()
{
int a, b,m, n, sum,comp = 0;
scanf(“%d %d”, &a, &b);
while (a>0 && b>0)
{
m = a%10;
n = b%10;
sum = m + n;
a = a/10;
b = b/10;
if (sum > 9)
{
comp++;
}
}
if (comp == 1) //comp will be positive if confusion comes many nums later...
{
printf("Yes\n");
}
else
{
printf("NO\n");
}
return 0;
}
This got 3rd test wrong answer. Why?