Languages-C & C Plus Plus [TCS Placement]: Sample Questions 4 - 5 of 119

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 4

C & C Plus Plus
Edit

Write in Short

Short Answer▾

What is c ++ ?

Explanation

  • Released in 1985, C ++ is an object-oriented programming language created by Bjarne Stroustrup.
  • Similar to C- simplifying memory management and adding features - including a new datatype known as a class - to allow object-oriented programming.
  • C ++ allows for low-level memory access but also gives the programmer tools to simplify memory management.
  • Is used to make CGI scripts or console-only DOS programs.

Question 5

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is the difference between the = symbol and == symbol?

Explanation

  • Assignment Operator (=)
  • = is an Assignment Operator in c, c ++ and other programming languages, it is Binary Operator which operates on two operands.
  • = assigns the value of right side expression՚s or variable՚s value to the left side variable
  • Example:

    x = (a + b) ;

    y = x;

  • Here, when first expression evaluates value of (a + b) . It will be assigned into x and in second expression y = x; value of variable x will be assigned into y.
  • Equal To Operator (==)
  • It is binary operator which operates on two operands.
  • == compares value on left and right side expressions- return 1 if they are equal otherwise return will be 0;
  • Example:
  1. intx, y;
  2. x=10;
  3. y=10;
  4. if(x==y)
  5. printf(“True”);
  6. else
  7. printf(“False”);
  • When expression x == y evaluates, it will return 1 and “TRUE” will be printed.

Developed by: