Advertisement
for (i=1;i<10;i++){
cout<<i<<endl;
}
- A
i=1;
while(i<10){
cout<<++i<<endl;
} - B
for (int i:{1,2,3,4,5,6,7,8,9}) {
cout<<i<<endl;
} - C
i = 1;
do {
cout<<i++<<endl;
} while(i<10); - D
i = 1;
loop:
cout<<i++<<endl;
if(i<10) goto loop;
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.