Computer Language Practice Question and Answer

Q:

Which of the following are Operators in C?

603 0

  • 1
    arithmetic operators
    Correct
    Wrong
  • 2
    logical operator
    Correct
    Wrong
  • 3
    relational operators
    Correct
    Wrong
  • 4
    all of the above
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 4. "all of the above"
Explanation :

Operators are symbols that we use when performing operations on one or more operands. The primary types of operators in C are arithmetic, logical, relational, conditional, bitwise, and assignment.

Q:

Why is clrscer() used?

443 0

  • 1
    to erase
    Correct
    Wrong
  • 2
    to clear the message from the screen
    Correct
    Wrong
  • 3
    to store
    Correct
    Wrong
  • 4
    for all of the above
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 2. "to clear the message from the screen"
Explanation :

The clrscr in C is a built-in function that is used for clearing the screen of the console output during the execution of the C program. This function is defined in the conio. h header file. We need to include the “conio.

Q:

What is the difference between do-while and while condition?

584 0

  • 1
    In do-while, a semicolon is used after the condition.
    Correct
    Wrong
  • 2
    Semicolon is not used in While
    Correct
    Wrong
  • 3
    While statement is after the condition
    Correct
    Wrong
  • 4
    none of the above
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 4. "none of the above"
Explanation :

The key difference lies in when the loop condition is checked. In the while loop, the condition is checked before the first iteration, potentially resulting in zero iterations. In the do-while loop, the condition is checked after the first iteration, ensuring that the loop body is executed at least once.

Q:

Which of the following is not true for for-loop?

559 0

  • 1
    for (i=0; i
    Correct
    Wrong
  • 2
    for (int i=0; i>9; i++)
    Correct
    Wrong
  • 3
    for (i=10; i
    Correct
    Wrong
  • 4
    for (i=10; i++; i
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 4. "for (i=10; i++; i"
Explanation :

Among the given statements about for loops, the one that is NOT true is that they are used to replace user input while loops. While for loops are typically used for iterations with a known count and are less likely to result in an infinite loop if used correctly, they do not specifically replace user input while loops.

Q:

Array is used for-

634 0

  • 1
    To store the value in memory
    Correct
    Wrong
  • 2
    To delete the value in memory
    Correct
    Wrong
  • 3
    for output
    Correct
    Wrong
  • 4
    all of the above
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 4. "all of the above"
Explanation :

An array is used to store values in memory. Arrays allow you to store multiple values of the same data type under a single variable name, making it easier to manage and manipulate data in programming. Arrays are commonly used in various programming languages for tasks such as storing collections of data, performing calculations on large sets of values, and iterating through elements to process them. Arrays are not used for deleting values in memory or for output; their primary purpose is to store and organize data.

Q:

With which of the following is the Break statement used?

525 0

  • 1
    if Statement
    Correct
    Wrong
  • 2
    else if Statement
    Correct
    Wrong
  • 3
    Switch Statement
    Correct
    Wrong
  • 4
    None of these
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 3. "Switch Statement"
Explanation :

The break statement is used with loops (such as for and while loops) and switch statements in programming. In loops, it is used to exit the loop prematurely, while in a switch statement, it is used to exit the switch block after executing a specific case.


Q:

What is it called when more than one if-statement is used together?

511 0

  • 1
    if-else statement
    Correct
    Wrong
  • 2
    nested statement
    Correct
    Wrong
  • 3
    more if statements
    Correct
    Wrong
  • 4
    None of the above
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 2. "nested statement"
Explanation :

Certainly! A nested if statement refers to an if statement that is placed inside another if statement or other control structures. It allows for more specific conditions and complex decision-making in a program. The inner if statement is only executed if the outer if statement's condition is true.


Q:

Computer language FORTRAN is useful in which field?

837 0

  • 1
    business
    Correct
    Wrong
  • 2
    Drawing
    Correct
    Wrong
  • 3
    Science
    Correct
    Wrong
  • 4
    Commerce
    Correct
    Wrong
  • Show AnswerHide Answer
  • Workspace

Answer : 3. "Science"
Explanation :

FORTRAN (short for "Formula Translation") is a high-level programming language that is particularly well-suited for scientific and engineering applications. It was developed for numeric and scientific computing and is widely used in fields such as physics, engineering, mathematics, and other scientific disciplines. FORTRAN allows for efficient processing of mathematical and scientific computations, making it a popular choice for complex scientific simulations, mathematical modeling, and computational research.

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully

      Report Error

    Please Enter Message
    Error Reported Successfully