0

Hi guys! Please help me out with this code!

1. Natural numbers are the set of positive integers, which ranges from 1 to infinity excluding fractional part. Natural numbers are whole numbers excluding zero. Zero is the only whole number which is not a natural number. An array is special if all the elements are natural numbers. Find whether the given array is special or not. 2. The first line of input contains a single integer n denoting the array size. The second line of input contains separated integers denoting the array. 3. Constraints: 1<=n<=100. 0<=Array element<=100. 4. Sample: Input: 4 5 0 7 4 Output: Array is not special //Due to 0 in input, array is not special 5. My problem: eg. Input, n=3 6 5 7 OUTPUT Obtained: Yes, array is special. Yes array is special. Yes array is special EXPECTED: Yes array is special. https://code.sololearn.com/cw656gUXUBMf/?ref=app

15th Sep 2019, 2:31 PM
A_Coder
A_Coder - avatar
6 Answers
+ 1
Thanks ~ swim ~ .. You said I can check the numbers without array!? Please how is this possible?
16th Sep 2019, 2:48 PM
A_Coder
A_Coder - avatar
+ 1
But then, what if the user's number is large. Will I have to read all the numbers individually? Or use a loop?
16th Sep 2019, 3:03 PM
A_Coder
A_Coder - avatar
+ 1
Ok, thanks!! I'll try that too.
16th Sep 2019, 3:10 PM
A_Coder
A_Coder - avatar