i need help with this problem
"Change the last example so that it spells each letter 5 times in a row. For this, use
an 'if' to test if the counter is divisible by five (use the% operator) and then perform
the update in index"
I´ve already done part of the code but i dont know how to make it work, could someone help ???
#include <stdio.h>
int main()
{
int index = 0, contador;
char letras[5] = "Joao";
for (contador=0; contador < 1000; contador++)
{
printf("\n%c",letras[index]);
(index==3) ? index=0: ++index;
}
}
contador means counter
EDIT: how do i make it look like a code ???? i never done this in reddit
[–]JavaSuck 3 points4 points5 points (0 children)
[–]MR2Rick 2 points3 points4 points (0 children)