© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Rukayat Balogun
Web Development and Data Science
Write a program that combines all three loops: Write a program that iterates over the English alphabet and prints each vowel letter 2 times before it then moves on to the next letter
Itz Mhizter Dan
l <- LETTERS[1:26] count <- 0 vowel <- c("A","E","I","O","U") for ( j in l) { if (j %in% vowel){ count <- 0 while(count < 2){ print(j) count <- count + 1 } } else{ print(j) } }
Eniola Elemide
Software Developer, Machine learning
alph <- LETTERS[1:26] vow <- c("A","E","I","O","U")
for (x in alph){ if(x %in% vow){ count <- 1 while(count < 2){ repeat { print(x) count <- count + 1 if (count > 2){ break } } } }else { print(x) } }