Questions

Q:

If the following program (myprog) is run from the command line as 

myprog 1 2 3 

what would be the output?

main(int argc, char *argv[])

{

    int i, j = 0;

    for (i = 0; i < argc ; i++)

           j = j + atoi ( argv[i]);

    printf ("%d", j);

}

A) 123 B) 6
C) Error D) "123"
 
Answer & Explanation Answer: B) 6

Explanation:

When atoi() tries to convert argv[0] to a number it cannot do so (argv[0] being a file name) and hence returns a zero.

Report Error

View Answer Report Error Discuss

Filed Under: Programming

2 13225
Q:

main()

{

float me = 1.1;

double you = 1.1;

if(me==you)

printf("yes");

else

printf("No");

}

A) Yes B) No
C) Both D) Compilation error
 
Answer & Explanation Answer: B) No

Explanation:

For floating point numbers (float, double, long double) the values cannot be predicted exactly. Depending on the number of bytes, the precession with of the value represented varies. Float takes 4 bytes and long double takes 10 bytes. So float stores 0.9 with less precision than long double.

Report Error

View Answer Report Error Discuss

Filed Under: Software Testing
Job Role: Software Architect

10 13221
Q:

Ball bearings are used in cycles, scooters etc to

A) Increase the friction between the wheel and the axle B) Reduce the friction between the wheel and the axle
C) Reduce the friction between ground and the whee D) None of the above
 
Answer & Explanation Answer: B) Reduce the friction between the wheel and the axle

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics

47 13219
Q:

The gland that is present close to Trachea

A) Pancreas B) Liver
C) Adrrenal D) Thyroid
 
Answer & Explanation Answer: D) Thyroid

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology

93 13210
Q:

Where is the headquarters of CARICOM?

 

A) Guyana B) Zimbabve
C) South Africa D) Namibia
 
Answer & Explanation Answer: A) Guyana

Explanation:

CARICOM is an official United Nations Observer. The Caribbean Community (CARICOM) is a grouping of twenty countries: fifteen Member States and five Associate Members.

 

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: Bank Exams

1 13198
Q:

Surface water resources are highest in

A) Ganga plains B) North-Eastern India
C) Peninsular India D) Indus Plains
 
Answer & Explanation Answer: A) Ganga plains

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography

48 13192
Q:

The 'Dual Economy' is a mixture of

A) traditional agriculture sector and modern industrial sector B) industrial sector and manufacturing sector
C) state ownership sector and trading of goods obtained through imports D) none of these
 
Answer & Explanation Answer: A) traditional agriculture sector and modern industrial sector

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

12 13190
Q:

Improve the bracketed part of the sentence.

 

Life in (more) thriving towns is intimately connected with the local trades and industries.

A) much B) much more
C) most D) No improvement
 
Answer & Explanation Answer: C) most

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: English
Exam Prep: Bank Exams

0 13184