Hi all ..
I'm trying to do this:
1111 x 1111 = 1234321 11111 x 11111 = 123454321 111111 x 111111 = 12345654321 1111111 x 1111111 = 1234567654321 11111111 x 11111111 = 123456787654321 111111111 x 111111111=12345678987654321
I wrote this code:
But I get this:Code:#include <stdio.h> int i; long long int product; int factor; int main(){ factor = factor * 10 + 1; for(i=0;i<8;i++){ factor = factor * 10 + 1; product = factor * factor; printf("%d x %d = %lld \n",factor, factor, product); } }
11 x 11 = 121
111 x 111 = 12321
1111 x 1111 = 1234321
11111 x 11111 = 123454321
111111 x 111111 = -539247567
1111111 x 1111111 = 1912040369
11111111 x 11111111 = -2047269199
111111111 x 111111111 = 1653732529
Some help please? Thanks. :-)