ExamCompetition Forum Question Papers Ask A Question Mock Test Learn & Earn Sign Up Login Menu



16 vote

What's wrong in the following statement, provided k is a variable of type int?for(k = 2, k <=12, k++)

Asked on by | Votes 16 | Views: 165 | Tags: computer science     | c programming     | control structures     | Add Bounty

What's wrong in the following statement, provided k is a variable of type int?for(k = 2, k <=12, k++)

A).  The increment should always be ++k .

B).  The variable must always be the letter i when using a for loop.

C).  There should be a semicolon at the end of the statement.

D).  The variable k can™t be initialized.

E).  The commas should be semicolons.


Share on Facebook      Share on Whatsapp       Share on Twitter




1 answers

36 vote
Answered by on | Votes 36 |

 The commas should be semicolons.



In for loop the three statements parts are separated by two semicolons which are missing here.

Join Telegram Group




Answer This Question

Name:
Email:
Answer :
Sum of (4+4)
Submit: