Questions

Q:

What would be the output of the following program?

main()

{

    extern int fun ( float );

    int a;

    a = fun ( 3. 14 );

    printf ("%d", a);

}

int fun ( aa )

float aa ;

{

     return ( (int) aa );

}

Answer

Error occurs because we have mixed the ANSI prototype with K & R style of function definition.


When we use ANSI prototype for a function and pass a float to the function it is promoted to a double. When the function accepts this double into a float a type mismatch occurs hence the error.


The remedy for this error could be to define the function as :


int fun (float aa)


{


  ....


}

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

9 8493
Q:

Which of the following is NOT correctly matched?

 

A) Loktak Lake - Manipur B) Sambhar Lake - Rajasthan
C) Lake Lonar - Maharashtra D) Hussain Sagar - Karnataka
 
Answer & Explanation Answer: D) Hussain Sagar - Karnataka

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: Bank Exams

1 8490
Q:

Whose period was known as the Golden Age of Rome?

Answer

 Augustus Caesar

Report Error

View answer Workspace Report Error Discuss

Subject: World History

21 8489
Q:

Among the following States, which one was formed last

A) Andhra Pradesh B) Gujarat
C) Karnataka D) Punjab
 
Answer & Explanation Answer: A) Andhra Pradesh

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics

12 8487
Q:

The Indus valley people traded with the

A) Chinese B) Mesopotamians
C) Parthians D) Romans
 
Answer & Explanation Answer: B) Mesopotamians

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

12 8486
Q:

Which among the following does NOT hold their office till the pleasure of President?

 

A) Governor of State B) Attorney General of India  
C) Chief Election Commissioner   D) Prime Minister of India  
 
Answer & Explanation Answer: C) Chief Election Commissioner  

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Politics
Exam Prep: Bank Exams

0 8482
Q:

The term ' Regur ' is used for

A) Alluvial soil B) Peat soil
C) Laterite soil D) Black soil
 
Answer & Explanation Answer: D) Black soil

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography

12 8478
Q:

Which of following sectors does NOT come under tertiary sector?

 

A) Electricity B) Business Services
C) Transport D) Trade
 
Answer & Explanation Answer: A) Electricity

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy
Exam Prep: Bank Exams

2 8464