Tuesday, March 14, 2023
HomePythonFor loophole executions in C Language

For loophole executions in C Language


In C programs language, the for loophole can be executed in the complying with means:

1. Timeless for loophole:

 for (initialization; problem; increment/decrement) {

declaration( s);.

}

Instance:

 for (int i = 0; i < < 10; i++) {

printf("% dn", i);.

}
  1. Infinite for loophole:
 for (;;) {

declaration( s);.

}

Instance:

 for (;;-RRB- {

printf(" This is an unlimited loopn");.

}
  1. For loophole without initialization as well as increment/decremen t:
 for (; problem;) {

declaration( s);.

}

Instance:

 int i = 0; for (; i < < 10;) {

printf("% dn", i); i++;.

}
  1. For loophole without problem:
 for (initialization;; increment/decrement) {

declaration( s);.

}

Instance:

 for (int i = 0;; i++) {

printf("% dn", i);.

if (i == 9).

break;.

}
  1. For loophole with numerous variables:
 for (initialization1, initialization2; problem; increment/decrement1, increment/decrement2) {

declaration( s);.

}

Instance:

 for (int i = 0, j = 10; i < < 10; i++, j--) {

printf(" i: %d, j: %dn", i, j);.

}

It is essential to keep in mind that the for loophole can be made use of in numerous mixes of these executions depending upon the need of the program.

RELATED ARTICLES

Most Popular

Recent Comments