February 15th, 2013, 05:56 AM
I recently started learning C language. I am thinking of a logic to build such a big number like.
Basically requirement is like, the number should be as long as the number i give as input... Example: if i say a=101,b=101 so the number will have 101 digits and the last number will be 1.
And if i say a=2,b=1 the number of digits will be Two(10) and first digit will be 1.
February 15th, 2013, 09:35 AM
You can store the digits of the number in a dynamic array.
February 23rd, 2013, 07:40 AM
Originally Posted by bullet
I wrote this code which worked fine. But, i guess this is not at all a best practice to loop a string for such a long time.
char a=" ";
count = 100;
input2 = rand()% count;
strcpy(a, " ");
Can anyone please improve my code to eliminate loops.