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▾
int i; main()
{
int t;for ( t=4;scanf("%d",&i)-t;printf("%d",i)) printf("%d--",t--);
}
If the inputs are 0,1, 2,3 find the output
EditExplanation
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
Explanation
- 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
Explanation
2-tier architecture: client server application
Two-tier architecture is divided into two parts:
- 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:
Three-tier architecture is divided into three parts:
In this client system handles presentation, application server handles application layer and server system handles database layer.