Search code examples
javarandomio

Output don't recognize alphabets


Okay so this my code where i try to print characters My code

however I do not understand why my output don't recognize the alphabetical char while printing in output. NOTE: I given input of length as 4 here. enter image description here


Solution

  • You need to fix the calculation of alphabet. For given input length as 4 the calculated value for number and alphabet is 2 and your second for-loop is created as for(int i = 2; i < 2; i++). The loop body will not be executed.