Which one?

Which one?
for (i=0; i

Attached: snowman genocide.jpg (781x960, 233K)

int i = 0;
int limit = 100;
while (i < limit) {
// do shit
i++;
}


"for" is the ugliest and most useless syntactic construct in programming history and needs to die

For i in range():

for i in 1..100 {

congrats using something much uglier, especially when nested

> while loop

Attached: 1549774265565.gif (500x284, 1.75M)

FOR I := 1 TO 10 DO

You ask "which one" as if they are somehow the same or interchangeable? The first example indices over the number 0, while the second does not. For many cases you actually need to indice over 0, when iterating an array for example.

The first one, obviously.

[0..99]

int i = 1;
for_A:

i+=1;
if(i>100) goto for_A;

>stop that autism op
if u want 99 choose the first if u want 100 choose the second why that is even a thread?

someone dropped out before the first semester was over.

No, while is useless since it's just a subset of for.

But they both iterate 100 times you absolute fucking brainlet.

>while is useless since it's just a subset of for

Attached: 1359223612030.jpg (259x286, 14K)

what is that mean to you?
if(0

>there are actually people out there who use 0 based indexing
Lmao @ u brainlets

Learn english before speaking to me, pajeet.

My level in English is basic because it is not my native language
How many languages do you know anyway?
and whatAbout your understanding in code?
It seems like you have no idea how a simple loop works

for(;cond;) {
}
Same amount of characters as while even.
for is the only loop you need.

for (size_t i=0; i < 100; ++i) {
/thread

most people here are multilingual, are between 24 and 28, and have at least some form of technical education.

good for you that you think you understand something when you probably don't really.

in any case it's no excuse for a subcompetence in english. get with the times or stay pleb. if it's the latter you choose, you might as well just leave.

int i = 0;
do {
//stuff
++i;
} while (i < 100);

//fight me

1) you don't /thread yourself
2) you didn't contribute to the thread
3) you don't seem to understand basic c++ data types.

feels good knowing poojeets will never have my job

for (i in 1:101){
}

First one since you're most likely iterating over an zero-indexed array.

nice

>you understand something when you probably >don't really.
How many languages do you know ???
And how well do you know them???
You prove your retardness in every sentence you post.

>most people here are between 24 and 28
Most people here are between 16 and 22

lol

Sir please listen Sir
First starts from 0 and ends at 99
Second starts from 1 and ends at 100
Both of them run for 100 times
Thank you Sir

map f [1..99]

>huuhhhduhhhh muh while looooop
imagine unironically using while loops like this -- kill yourselve -- you prob use 'do-while' loops too...

for (i=100; i--; ) {

Baste

Second one. Best for dealing with lists and websites. Why would you pick your 0 as the initial value unless you are some autist.

Attached: file.png (2438x515, 164K)

let eventTarget = new EventTarget();
eventTarget.addEventListener('loop1', event => {
//fight me harder daddy
event.detail < 100 &&
eventTarget.dispatchEvent(
new CustomEvent('loop1', {detail: event.detail+1}))
});
eventTarget.dispatchEvent(new CustomEvent('loop1', { iterator: 0});)

I did not say anything about the number that the loop is running...
It's a cheap mislead

The second one for COM. The first one for everything else. Unless you want segfaults, then use the second one.

Sir you are big joker Sir

This is the optimal solution because it's comparing to zero