Answer:
The solution code is written in C++
- void BigInt(int n){
-
- int i, j;
-
- for(i = 1; i <= n; i++){
-
- for(j = 1; j <= i; j++){
-
- if(j < 10){
-
- cout<<j;
- }
- else{
- cout<<0;
- }
-
- }
-
- cout<<"\\";
-
- }
- }
- int main()
- {
- BigInt(10);
-
- return 0;
- }
Step-by-step explanation:
Firstly, create a function BigInt that takes one input number, n.
Next, create a double layer for-loop (Line 5-21). The outer loop is to print one big number per iteration and the inner layer is keep printing the accumulated individual digit for a big number. To ensure the big number is printed one below the other, we print a new line in outer loop (Line 19).
In main program, we call the function to print the big number (Line 26).