---
title: "Comment by Rukayat Balogun on \"Loops in R (Chapter 1 Episode 6)\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/loops-in-r-chapter-1-episode-6/632049906c86d75accc80c5f/comment/632058356c86d75accc80f64"
---

[Discussion](https://hashnode.com/posts/loops-in-r-chapter-1-episode-6/632049906c86d75accc80c5f)

Comment [Loops in R (Chapter 1 Episode 6)](https://hashnode.com/posts/loops-in-r-chapter-1-episode-6/632049906c86d75accc80c5f)

[Rukayat Balogun](https://hashnode.com/@code-with-kemi)

[Sep 13, 2022](https://hashnode.com/posts/loops-in-r-chapter-1-episode-6/632049906c86d75accc80c5f/comment/632058356c86d75accc80f64)

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](https://hashnode.com/@danilexy405)

[Sep 13, 2022](https://hashnode.com/posts/loops-in-r-chapter-1-episode-6/632049906c86d75accc80c5f/comment/632058356c86d75accc80f64#reply-632064d75483096daa0a79e7)

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](https://hashnode.com/@Deenero)

[Sep 13, 2022](https://hashnode.com/posts/loops-in-r-chapter-1-episode-6/632049906c86d75accc80c5f/comment/632058356c86d75accc80f64#reply-632076b3af1ce46dbc5436c1)

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) } }
