Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 247 - 249 of 354

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

Question 247

C & C Plus Plus
Edit

Describe in Detail

Essay▾

Differentiate persistent & non-persistent objects?

Explanation

  • Persistent Objects:-
    • Persistent refers to an object՚s ability to transcend time or space.
    • Stores/saves its state in a permanent storage system without losing the information represented by the object.
    • Can exist for the duration of the application in a persistent store such as a database.
  • Non-persistent objects:-
    • A non-persistent object is said to be transient or ephemeral.
    • By default objects are considered as non-persistent.
    • A non-persistent object is created dynamically and discarded when obsolete.

Question 248

C & C Plus Plus
Edit

Describe in Detail

Essay▾

List out some of the OODBMS available.

Explanation

  • GEMSTONE/OPAL of Gemstone systems.
  • ONTOS of Ontos.
  • Objectivity of Objectivity Inc.
  • Versant of Versant objects technology.
  • Object store of Object Design.
  • ARDENT of ARDENT software.
  • POET of POET software.
OODBMS Applications

Question 249

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is the output of the following program?

  1. intswap (int ⚹a, int ⚹b)
  2. {
  3.     a =⚹ a +⚹ b;
  4.     b =⚹ a -⚹ b;
  5.     a =⚹ a -⚹ b;
  6. }
  7. main ()
  8. {
  9.     intx =10, y =20;
  10.     swap (&x, &y);
  11.     printf ( “x =%dy =%d”, x, y);
  12. }

Explanation

In this program

Table Shows the Program
int x = 10, y = 20;
  • Given the integer variable x = 10 and y = 20
swap (&x, &y) ;
  • This is use for swapping two values function
int swap (int ⚹ a, int ⚹ b)

{

⚹ a =⚹ a +⚹ b;

⚹ b =⚹ a -⚹ b;

⚹ a =⚹ a -⚹ b;

}

  • In a swap function a = x and b = y
  • So a = 10 and b = 20
  • a =⚹ a +⚹ b;

    ⚹ a = 10 + 20 = 30

  • ⚹ b =⚹ a -⚹ b;

    ⚹ b = 30 - 20 = 10

  • ⚹ a =⚹ a -⚹ b
⚹ a = 30 - 10 = 20
printf ( “x =% d y =% d” , x, y) ;
  • Now the printf print the value of x = 20and y = 10

Developed by: