Hi, If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. Write a function called number2letters that returns the number of letters needed to write down the number
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kavitha Komgari
el 30 de Jul. de 2018
Respondida: Kavitha Komgari
el 2 de Ag. de 2018
Hi, Really no idea how to start this question. PLease help.
0 comentarios
Respuesta aceptada
KALYAN ACHARJYA
el 30 de Jul. de 2018
Editada: KALYAN ACHARJYA
el 30 de Jul. de 2018
Here Answer:
n=input('Enter the number: ');
words_number=num2words(n);
disp(words_number);
str=upper(words_number(:));
AZ='A':'Z';
count=sum(ismember(str,AZ));
fprintf('The numbers of letter: %d',count);
6 comentarios
Stephen23
el 31 de Jul. de 2018
@Kavitha Komgari: you will need to download num2words from here:
Más respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!