Computer Science, asked by brokenmind580, 6 months ago

What will happen when we place a semicolon after the for loop. Explain with example.​

Answers

Answered by nivedia22
1

Explanation:

Semicolon is a legitimate statement called null statement * that means "do nothing". Since the for loop executes a single operation (which could be a block enclosed in {} ) semicolon is treated as the body of the loop, resulting in the behavior that you observed. ... ... do nothing (semicolon)

Answered by keshav2150
2

Semicolon is a legitimate statement called null statement * that means "do nothing". Since the for loop executes a single operation (which could be a block enclosed in {} ) semicolon is treated as the body of the loop, resulting in the behavior that you observed.

example-

If you place semicolon after a for loop then it is technically correct syntax. Because it is considered as an empty statement - that means nothing to execute. for(i=0;i<n;i++); ... The curly braces {} after the for loop executed only once

Note-googled it

Source-google

| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄l

|   thanks if you l

I  liked my answer l

I Or marked it l

I Brainliest l            

|_________l

(\__/) ||  ll (\__/)

(•ㅅ•) ||  ll (•ㅅ•)

/   づ  ⊂ \

Similar questions