# Languages [3i Infotech Placement]: Sample Questions 5 - 6 of 546

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

## Question 5

### Question

MCQ▾

In the following code segment what will be the result of the function value of x, value of y

1. `{`
2. `    unsigned int x =-1;`
3. `    int y;`
4. `    y =~0;`
5. `    if (x == y)`
6. `    printf ( “same” );`
7. `    else`
8. `    printf ( “not same” );`
9. `}`

### Choices

Choice (4)

a.

Not same

b.

Same, MAXUNIT, MAXUNIT

c.

Same

d.

Not same, MAXINT

c.

### Explanation

• In the program
 unsigned int x =-1; define the unsigned integer variable x =-1 int y; define the integer variable y y = ~0; ~0 is the binary representation of -1 `if (x == y)``printf ( “same” );``else``printf ( “not same” );``}` Check the if condition`if (-1 == -1)``printf ( “same” );``else``printf ( “not same” );``}`So the answer is same

## Question 6

Languages

### Question

MCQ▾

Without the use of Cartesian product, how many joining conditions are required to join tables?

Choice (4)

a.

1

b.

3

c.

4

d.

2

b.

### Explanation

• To join ‘n’ tables ‘n-1’ conditions should be satisfied so to join tables conditions should be satisfied.
• Join is used to collate data from two more tables- joined to appear as single table of data.
• Combines columns from two or more tables by using values common to both table.
• “Join” keyword is used in SQL queries for joining two or more tables.
• Minimum required condition for joining table is (n-1) where n, is number of tables.
• A table can also join to itself, which is known as self join.

Developed by: