#Day65 #100DaysChallenge- Matlab Loops| Printing Alphabet
#Day65-Printing Alphabet
Task:
Write a code to print alphabets in given range
Start Character:g Stop Character:p
g h i j k l m n o p
Note: This code can be done using the in-built command. But for the challenge, I am trying to avoid those.
Start Character:g Stop Character:p
g h i j k l m n o p
Note: This code can be done using the in-built command. But for the challenge, I am trying to avoid those.
Matlab code
function printingalphabet(n,m)
for i=n:1:m
fprintf('%c',i);
fprintf('\t');
end
>> printingalphabet('a')
a b c d e f g h i j k l m n o p q r s t u v w x y z
>> printingalphabet('f')
f g h i j k l m n o p q r s t u v w x y z >> printingalphabet('s')
s t u v w x y z >> printingalphabet('s','y')
s t u v w x y >> printingalphabet('g','p')
g h i j k l m n o p
Free Codes: youtube.com/castorclasses
No comments