3i Infotech Placement: Sample Questions 919 - 921 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 919

Edit

Write in Short

Short Answer▾

What is the output of the following program?

main(){ unsignedinti=65000; while(i++!=0); printf("%d",i);}

Explanation

In the program

Table Shows the Program
unsigned int i = 65000;Define the unsigned integer variable i = 65000.
while (i ++ ! = 0) ;

printf ( “% d” , i) ;

Note the semicolon after the while statement.

When the value of i becomes 0 it comes out of while loop.

Due to post-increment on i the value of i while printing is 1

Question 920

Edit

Write in Short

Short Answer▾

What is passive topology?

Explanation

Understanding of Linear Bus
  • When the computers on the network simply listen and receive the signal, they are referred to as passive because they don՚t amplify the signal in any way.
  • Example for passive topology - linear bus.
  • Linear bus topology consists of a main run of cable with a terminator at each end.
  • All nodes are connected to the linear cable.
  • Ethernet and local talk network use a linear bus topology.

Question 921

Appeared in Year: 2004

Question

MCQ▾

What is the output of following piece of code?

  1. intx =2.
  2. switch (x)
  3. {
  4.     case1:System. Out. Println ( “1” );
  5.     case2:Case3:System. Out. Println ( “3” );
  6. case4:Case5:System. Out. Println ( “5” ); }

Choices

Choice (4)

a.

135

b.

35

c.

No output

d.

3

Answer

b.

Explanation

Dicleration of Integer Value X as 2
Int Declare integer value x as
Switch (x)The Switch expression should be an integer or a variable or an expression that evaluates to an integer.
case 1: System. Out. Println ( “1” ) ;In case output is printed But this will not be selected
case 2: case 3: System. Out. Println ( “3” ) ;In Case output is printed. Of course, this case would be selected, as the value of switch expression is .
case 4: Case 5: System. Out. Println ( “5” ) ;}In case output printed is would also be printed as there is no break inside 3: , so execution simply continues to Thus output will be

Developed by: