Languages [3i Infotech Placement]: Sample Questions 40 - 42 of 546

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

Question 40

Edit

Write in Short

Short Answer▾

What is the use of ‘using’ declaration.

Explanation

  • A using declaration makes it possible to use a name from a namespace without the scope operator.
  • Using declaration can be used to introduce namespace members into other namespaces and block scopes, or to introduce base class members into derived class definitions.
Define the Using Declaration for a Class Member Shall be a Member Declaration

Question 41

Edit

Describe in Detail

Essay▾

A process is defined as

Explanation

Given Process Control Block
  • A process is an instance of an executing computer program.
  • Contains the program code and its current activity.
  • Note that a program is the passive collection of instruction, while a process is the actual execution of instructions.
  • Many processes can be associated with the same program.
  • A process can initiate a sub process, which is called a child.
  • A child process is a replica of the parent process sharing its resources, but dies with the parent.
  • Processes exchange information and synchronize operation using interprocess communication.

Question 42

Edit

Describe in Detail

Essay▾
  1. #definef (g, g2) g##g2
  2. main ()
  3. {
  4.     intvar12 =100;
  5.     printf ( “%d” f (var, 12) );
  6. }

Explanation

  • In a program,
    Table Showing the Program
    #define f (g, g2) g##g2The ## is a concatenation operator,

    When you pass the two arguments they get concatenated asi/p ⇾ f (g, g2) g##g2o/p ⇾ gg2

    int var12 = 100;Define the integer variable var12 = 100
    printf ( “% d” f (var, 12) ) ;hencef (var, 12) will give us var12effectively the printf statement gets modified as printf ( “% d” , f (var, 12) ) ; ⇾ printf ( “% d” , var12) ;
  • So, the answer is 100

Developed by: