3i Infotech Placement: Sample Questions 404 - 406 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 404

Write in Short Short Answer▾

  1. int i; main()
  2. {
  3. int t;for ( t=4;scanf("%d",&i)-t;printf("%d",i)) printf("%d--",t--);
  4. }

If the inputs are 0,1, 2,3 find the output

Edit

Explanation

4 - 0

3 - 1

2 - 2

In the program

int i;

Define the global integer variable i.

int t;

Define the integer variable t in main class.

for (t = 4; scanf ( “% d” , &i) -t; printf ( “% d” , i) )

Given the for loop

Using the input values of 0,1, 2,3 for ‘scanf’ x = scanf ( “% d” , &i) -t the values during execution will be,

t

i

x

4

0

-4

3

1

-2

2

2

0

Question 405

Describe in Detail Essay▾

Which keyword is used to inherit a class?

Edit

Explanation

Understanding of Extend Inherit Class
  • Extends keyword is used to inherit a class.
  • It is overrides all the methods and variables in the parent class there reusability of code is achieved.

Syntax

class Super

{

}

class Sub extends Super

{

}

Question 406

Describe in Detail Essay▾

Explain 2-tier and 3-tier architecture?

Edit

Explanation

2-tier architecture: client server application

Structure of 2-Tier Architecture

Two-tier architecture is divided into two parts:

Two-Tier Architecture
  • Client system handles presentation and application and server handles database.
  • Communication takes place between the client and server-Client requests the server and server processes the request and sends back the data to the client.

3-tier architecture:

Define 3-Tier Architectur

Three-tier architecture is divided into three parts:

Three-Tier Architecture

In this client system handles presentation, application server handles application layer and server system handles database layer.