Hello,
I had more of a conceptual question regarding a program I am trying to execute. The desired output I am trying to achieve is:
1,11,111,1111,11111,111111,1111111
Here was what I tried:
It seemed relatively logical since the way to obtain the sequence is by using 10^k-1/9 in math. But being new to C, I don't have much experience so this has baffled me. Any tips, hints, suggestions, or solutions to this problem would be greatly appreciated. Thanks.Code:#include <stdio.h> int main() { int k; k = 0; while ( k < 1111111 ) { printf("The value of k = %3d\n\n", (10^k-1/9) ); k = k +1; } }