Paper Tayyari

Lecture 30: Layout & Comments in Java and C++

MCQs, short and long questions from lecture 30.Lecture 30 ki MCQs, short aur long sawal.

6 MCQs · 6 short questions · 6 MCQs from past papers6 MCQs · 6 short sawal · 6 MCQs past papers se

Start mock testMock test shuru karein
DoneHal kiye 0/6
– correctsahi
1.
★ Final term Spring 2010

All comments should be written in-----------

  1. AEnglish
  2. BFrench
  3. CC++
  4. DJAVA

The guideline is that all comments are written in English.

2.
★ VU quiz

Comments are not syntax checked

  1. ATRUE
  2. BFALSE

The compiler ignores comments, so their content is never syntax checked.

3.
★ VU quiz

Comments should NOT be indented relative to their position in the code

  1. ATRUE
  2. BFALSE

Comments should be indented relative to their position in the code.

4.
★ VU quiz

Which of the following shows a commented statement in C++

  1. A# Ans = first + second
  2. B// Ans = first + second
  3. C\\ Ans = first + second
  4. D/# Ans = first + second

// starts a single-line comment in C++.

5.
★ VU quiz

Which of the following is used for multi level commenting?

  1. A// Comment
  2. B/* Comment */
  3. C(Comment)
  4. D*/ Comment/*

/* ... */ can span several lines.

6.
★ VU quiz

Which indent size eliminates the chance of code lines splitting?

  1. A2
  2. B4
  3. C3
  4. D6

The guideline recommends a basic indentation of 2; larger indents increase line splitting.