3i Infotech Placement: Sample Questions 678 - 680 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 678


Write in Short

Short Answer▾

What is the output of the following program?

  1. main ()
  2. {
  3.     inti =0;
  4.     intj =0;
  5.     if (i && j ++ )
  6.     printf ( “%d..%d”, i ++, j);
  7.     printf(” %d..%d”, i, j);
  8. }


In the program

Table Shows the Program
int i = 0;

int j = 0;

  • Define the value of i is 0 and j is 0- this information is enough to determine the truth-value of the boolean expression.
  • So, the statement following the if statement is not executed.
printf ( “% d. . % d” , i, j) ;The values of i and j remain unchanged and get printed.

Question 679


Describe in Detail


What is a pointer?


Understanding of Pointer to a Variable
  • Pointer in C language is a variable that stores the address of another variable.
  • A pointer in C is used to allocate memory dynamically at run time.
  • The pointer variable might “point” to any the data type as int, float, char, double, short etc.


Data_type ⚹ var_name;


int ⚹ p;

char ⚹ p;

  • Where, ⚹ is used to denote that “p” is pointer variable and not a normal variable.

Question 680


Write in Short

Short Answer▾

Difference between pass by reference and pass by value.


Difference between Pass by Reference and Pass by Value
Pass by valuePass by reference
Passes an argument by value.Passes an argument by reference.
Specified the ByVal keyword.Specified the ByRef keyword.
The procedure code does not access the underlying element in the calling code.The procedure code gives a direct reference to the programming element in the calling code.
We are sending a copy of the data.We are passing the memory address of the data that I stored.
Changes do not affect the actual value.Changes to the value affect the original data.

Developed by: