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 9198
Q:

In which state was the Nalanda University located in India

A) Bengal B) Bihar
C) Orissa D) Uttar Pradesh
 
Answer & Explanation Answer: B) Bihar

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

7 9197
Q:

How many legs a mosquito has

 

A) 4 B) 6
C) 8 D) 10
 
Answer & Explanation Answer: B) 6

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Animals and Birds
Exam Prep: Bank Exams

4 9193
Q:

Unit of solid angle is

A) degree B) radian
C) steradian D) radian second
 
Answer & Explanation Answer: C) steradian

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics

20 9182
Q:

An objective of the National Food Security Mission is to increase the production of certain crops through area expansion and productivity enhancement in a sustainable manner in the identified districts of the country. What are those crops?

A) Rice and Wheat only B) Rice, Wheat and pulses only
C) Rice, Wheat, Pulses and oil seeds only D) Rice, Wheat, Pulses, oil seeds and vegetables
 
Answer & Explanation Answer: B) Rice, Wheat and pulses only

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

8 9182
Q:

Which type of Stem modification is seen in banana ?

A) Rhizome B) Stem tuber
C) Corn D) Bulb
 
Answer & Explanation Answer: A) Rhizome

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Biology
Exam Prep: AIEEE

38 9180
Q:

Which one of the following is an element?

A) Topaz B) Rruby
C) Diamond D) Sapphire
 
Answer & Explanation Answer: C) Diamond

Explanation:

Here in the given options, Diamond is an element as it is the allotrope of the carbon atom.

Report Error

View Answer Report Error Discuss

Filed Under: Chemistry
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO

14 9172
Q:

Undefined reference to 'pthread_create'

How to Fix this error?

Answer

This is a common error while compiling C program in Linux. This error occurs when you are using pthread_create function to create threads in your programs.


To fix this problem ensure following points:
Include header file pthread.h in your program.
Add –lpthread linker flag with compilation command.
1- Include Header file
#include <stdio.h>
#include <pthread.h>
...
...
2- Compile command
gcc main.c -o main -lpthread

Report Error

View answer Workspace Report Error Discuss

24 9171