Printing the letters from A-Z using recursion in c# -
so here's have for, i'm trying print numbers a-z prints z, please , (using recursion)
using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.io; namespace atozrecursion { class program { static void main(string[] args) { int number=65; getaplha(number); console.writeline(convert.tochar(getaplha(number))); console.readkey(); } public static int getaplha(int number=65) { if (number==90) { return convert.tochar(number); } return convert.tochar(getaplha(number + 1)); } }
}
remove writeline
main
, put @ start of getalpha
, every letter printed, there call each letter.
Comments
Post a Comment