I recommend this method over a for (t = 0; t < b; t++). Imagine if you were using 64-bit math, the for loop would take a long time, even on a computer. OP doubling method of a=a+a was on track, but incomplete.
unsigned a;
unsigned b;
unsigned product = 0;
scanf("%u%u", &a, &b);
while (b > 0) {
if (b & 1) {
unsigned OldProduct = product;
product += a;
if (product < OldProduct) {
printf("\nOverflow\n");
break;
}
b >>= 1; // Halve b
a += a; // Double a - avoid using multiplication
}
printf("\nProduct = %u\n", product);