Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 51 - 53 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 51

C & C Plus Plus

Write in Short

Short Answer▾
  1. #definesquare (x) x ⚹x
  2. main ()
  3. {
  4.     inti;
  5.     i =64/square (4);
  6.     printf ( “%d” i);
  7. }


In a program

Table Shows the Program
int i;Define integer variable i
i = 64/square (4) ;macro call square (4) will substituted by 4 ⚹ 4so the expression becomes i = 64/4 ⚹ 4.

Since/and ⚹ has equal priority the expression will be evaluated as (64/4) ⚹ 4

i.e.. . 16 ⚹ 4 = 64

printf ( “% d” i) ;Print the value of i is 64

Question 52

C & C Plus Plus

Describe in Detail


What is a node class?


A node class is a class that has added new services or functionality beyond the services inherited from its base class.

A node class:

  • Relies on the base class for services and implementation,
  • Provides a wider interface to the users than its base class
  • Relies primarily on virtual functions in its public interface
  • Depends on all its direct and indirect base class
  • Can be understood only in the context of the base class
  • Can be used as base for further derivation
  • Can be used to create objects.
Define the Image is Node Class Code

Question 53

C & C Plus Plus

Write in Short

Short Answer▾
  1. main ()
  2. {
  3.     externinti;
  4.     i =20;
  5.     printf ( “%d” i);
  6. }


  • In a program extern storage class in the following declaration
  • Here, given extern int i;
  • Specifies to the compiler that the memory for i is allocated in some other program.
  • That address will be given to the current program at the time of linking.
  • However, linker finds that no other variable of name i is available in any other program with memory space allocated for it.
  • So, a linker error has occurred.

Developed by: