IT Trainer Questions


Q:

Give an example for the use of volatile keyword in c++ ?

Answer

Most of the times compilers will do optimization to the code to speed up the program. For example in the below code,


int k = 15;
while( k == 15)


{
// Do something
}


compiler may think that value of 'k' is not getting changed in the program and replace it with 'while(true)', which will result in an infinite loop. In actual scenario, the value of 'k' may be getting updated from outside of the program.


Volatile keyword is used to tell compiler that the variable declared using 'volatile' may be used from outside the current scope, so that compiler won't apply any optimization. This matters only in case of multi-threaded applications.


In the above example if variable 'k' was declared using volatile, compiler will not optimize it. In shot, value of the volatile variables will be read from the memory location directly.

Report Error

View answer Workspace Report Error Discuss

5 5918
Q:

LCD of 12 and 18

A) 36 B) 42
C) 12 D) 6
 
Answer & Explanation Answer: A) 36

Explanation:

  LCD is nothing but Lowest or Least Common Denominator

 

Here LCD of 12 and 18 means LCD of two fractions with denominators 12 and 18 respectively.

 

Therefore, LCM of 12 & 18 = 6 x 3 x 2 = 36 

 

      •  How to calculate LCD ::


The lowest common denominator or least common denominator (LCD) is the least common multiple (LCM) of the denominators of a set of fractions.

Report Error

View Answer Report Error Discuss

Filed Under: HCF and LCM
Exam Prep: GRE , GATE , CAT , Bank Exams , AIEEE
Job Role: IT Trainer , Database Administration , Bank PO , Bank Clerk

27 5913
Q:

As compared to diskettes, the hard disks are

A) More portable B) Slowly accessed
C) More expensive D) Less rigid
 
Answer & Explanation Answer: C) More expensive

Explanation:

As compared to diskettes, the hard disks are more expensive.

As_compared_to_diskettes,_the_hard_disks_are1557378986.jpg image

A diskette is a RAM, removable data storage medium that can be used with personal computers. It is also known as Floppy or Floppy disk. It is composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic enclosure lined with fabric that removes dust particles.

Report Error

View Answer Report Error Discuss

7 5905
Q:

Values that are used to end loops are referred to as _____ values.

A) stop B) sentinel
C) end D) finish
 
Answer & Explanation Answer: B) sentinel

Explanation:
Report Error

View Answer Report Error Discuss

4 5901
Q:

Unresolved dissonance is a characteristic of

Answer

When the tension is unresolved, we have unresolved dissonance. Unresolved dissonance is a characteristic of the baroque music.


The general characteristics of Baroque music is movement, energy, and tension.

Report Error

View answer Workspace Report Error Discuss

2 5869
Q:

Which of the following are elements of SQL?

A) base-table-identifier ::= user-defined-name B) base-table-name ::= base-table-identifier
C) boolean-primary ::= comparison-predicate D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:
Report Error

View Answer Report Error Discuss

8 5844
Q:

Which of the following type casts will convert an Integer variable named amount to a Double type ?

A) (int to double) amount B) int (amount) to double
C) int to double(amount) D) (double) amount
 
Answer & Explanation Answer: D) (double) amount

Explanation:
Report Error

View Answer Report Error Discuss

6 5841
Q:

How many laws of physics are there?

A) 5 B) 4
C) 3 D) 2
 
Answer & Explanation Answer: C) 3

Explanation:

Physics has 5 laws. But the 3 laws of Newton has been clubbed together under one Law. Therefore there are 3 Newtons laws of Physics. They are ::

 

1. Newtons Laws of Motion

    a. First Law of Motion

    b. Second Law of Motion

    C. Third Law of Motion

 

2. Newtons Law of Cooling

 

3. Newtons Law of Gravitation.

Report Error

View Answer Report Error Discuss

Filed Under: Physics
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO , Database Administration , IT Trainer

10 5809