loading...

CS201 Introduction to Programming Quiz 2 Fall 2012

CS201 Introduction to Programming Quiz 2 Fall 2012

 

 

 

 

 

 

 

 

 

Telling a computer what to do is called ________.

What will be the output of following code segment? for (int i = 2; i<10; i++){ if ( i == 5) continue; cout i “,” ; }

In if structure the block of statements executes when the condition is _____.

When the logical operator && combines two expressions then the result will be true only when the both expressions are ____________

If int a = 50; then the value of a/= 3; will be,

In if structure the block of statements executed when the condition is _____.

In the given expression which operator will be evaluated first? 10 + (6 / 2) – 2 * 3?

< , <= , > , >= are called __________ operators

Correcting the errors from a program is termed as __________.

< and > both arerelatinal operators

If x is declare as an integer, what will be result of the given expression? x = 2 + 3 * 5 % 2 + 3 / 2

Another quiz

Which of the following will be the most appropriate data type to store the value 63.547?

  • intger
  • character
  • flot

short

  • __________ operator is used to pass the address of a variable in call by reference method.
  • +
  • %
  • @
  • &
  • A ___________ structure specifies that an action is to be repeated while some condition remains true.
  • control
  • logical
  • Repetition

Relational

  • += , *= , /= , etc are called,
  • Assignment operators
  • Compound assignment operator
  • Unary operator
  • logical

 

  • ( ) parenthesis are not allowed in expressions
  • Division by zero will occur in this expression
  • Order of the expression is not according to rules
  • We can not use % operator in expressions
  • If we assign 2.06721 to an integer variable x, what will be the output if we print x using cout statement?
  • 2
  • 2.1
  • 2.06
  • 2.07
  • What will be the value of the variable output in the given piece of code? double output = 0; output = (2 + 2) * 4 + 2 / (4 – 2);
  • 15
  • 17
  • 12
  • 11

 

  • When a = 26; then the expression a%= 5; will calculate the value of a as,
  • 1
  • 035
  • 1
  • 0
  • 3
  • 5
  • Operating System is a type of ___________ software.
  • device derivr
  • applican
  • system
  • utelity

While loop becomes infinite in which scenario _______.

  • When the condition is always False
  • When the condition is always True
  • Condition contains logical operators
  • Condition contains arithmetic operators

 Another Quiz

While loop becomes infinite in which scenario _______.

When the condition is always False

When the condition is always True

Condition contains logical operators

Condition contains arithmetic operators

 

In C/C++; by default arguments are passed by _______ to a function.

  • Reference
  • Value

    Type

    Data

    != operator is used to check whether the operand on the left-hand-side is ___________ to the operand on the right-hand-side.

    Less than or equal

     

    Greater than or equal

    Not equal

    Approximately equal to

     

     

    First step in designing a program is

    Coding

    Compiling

    Linking

    Analysis

    __________ operator is used to pass the address of a variable in call by reference method.

    • +
    • %
    • @
    • &

       

      += , *= , /= , etc are called,

      Assignment operators
      Logical operator

      Compound assignment operator

      Unary operator

       

      If we pass more than one arguments to a function then they are separated by ___________.
      Comma ,

      Colon :

       

      Semicolon ;

      Double quotes “

 

DOWNLOAD SOLUTION HERE
loading...