Cpp | SoloLearn: Learn to code for FREE!

+1

Cpp

How can I write it with arrays ? 1000 0200 0030 0004

6/4/2020 5:00:59 PM

Emre CAMUSOĞLU

4 Answers

New Answer

+1

Do you mean like: int arr[4]={1000,0200,0030,0004};

+1

You wrote it like : Int arr[4] = {1000, 0200, 0030, 0004};

+1

u should write :a 2d ayyay int arr [4][4]:{{1,0,0,0},{0,2,0,0},{0,0,3,0},{0,0,0,4} }

0

You can easily do it using for loops, you only need to know the length of the arrays.