3i Infotech Placement: Sample Questions 862 - 864 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 862

Edit

Write in Short

Short Answer▾

Describe the main characteristics of static functions.

Explanation

  • The main characteristics of static function include,
  • It is without the a this pointer,
  • It can՚t directly access the non-static members of its class
  • It can՚t be declared const, volatile or virtual.
  • It doesn՚t need to be invoked through an object of its class, although for convenience, it may be invoked in this way
Given the Image is a Characteristic of Static Function Member

Question 863

Edit

Describe in Detail

Essay▾

What is guard condition?

Explanation

  • Guard condition acts as a firewall- access to an object can be made only when the “guard” condition is met.
  • For example, object customer can accesses the ATM facility only when the guard condition of “correct PIN” is met.
  • Guard condition is also called an interaction constraint- Boolean conditional expression guards an interaction operand in a combined fragment
Image Describes the Guard Condition

Question 864

Edit

Describe in Detail

Essay▾
  1. main ()
  2. {
  3.     char ⚹p =“haifriends” ⚹p1;
  4.     p1 =p;
  5.     while ( ⚹p! =‘⧵0’ ) ++ ⚹p ++;
  6.     printf ( “%s %s” p, p1);
  7. }

Explanation

In a program ++ ⚹ p ++ will be parsed in the given order.

Table Shows the Program
char ⚹ p = “hai friends” ⚹ p1;Given the character pointer p and its value
while (⚹ p! = ‘⧵0’ ) ++ ⚹ p ++ ;
  • Here, ⚹ p that us value of the location currently pointed by p will be taken.
  • ++ ⚹ p the retrieved value will be incremented.
  • When; is encountered the location will be incremented that is p ++ will be executed.
  • While loop initial value pointed by p is ‘h’ which is changed to ‘i’ by executing ++ ⚹ p and pointer moves to point, ‘a’ which is similarly changed to ‘b’ and so on.
  • Similarly blank space is converted to ‘!’
printf ( “% s % s” p, p1) ;Thus, we obtain value in p becomes ‘ibj! gsjfoet’ and since p reaches ‘⧵0’ and p1 points to p thus p1 does not print anything.

Developed by: