Questions

Q:

Can I increase the size of a dynamically allocated array? < Yes / No> if yes, how?

Answer

Yes, using the realloc() function as shown below:


main()


{


        int *p;


        p = ( int *) malloc (20) ;


        t = p;


        t = (int *) realloc ( p, 40);


        if ( t == NULL )


        Printf (" Cannot reallocate, leaves previous allocated region unchanged ");


       else


       {


              if ( p ==t )


              ;  / * the array expanded at the same region */


             else


            { 


                 free ( p ); / * deallocate the original array */


                 p = t;  /* set p to newly allocated region */


             }


      }


}  

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

1 4924
Q:

Logical puzzle

At a restaurant, how could you choose one out of three desserts with equal probability with the help of a coin? What if the coin is biased and the bias is unknown?

Answer

Our solution:


Toss the coin twice.
Let TH, HT and TT correspond to the three choices.
And if you get HH, just repeat (so it takes 8/3 tosses on average).


BIASED COIN

If the coin was biased, TH and HT would occur with equal probability.
So you could assign THHT, HTTH and THTH to the three choices, with other 4-toss outcomes rejected.
Or you could assign HTT, THT and TTH to the three choices, with other 3-toss outcomes rejected.

Report Error

View answer Workspace Report Error Discuss

Subject: Logic Puzzles

18 4923
Q:

Who was the first black tennis player to win a Wimbledon title

A) Steffi Bucher B) Gegata Sen
C) Althea Gibson D) Sucheta Kriplani
 
Answer & Explanation Answer: C) Althea Gibson

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Sports

1 4923
Q:

The second Five Year plan was based on

A) Mahalanobis Model B) Vakil and Brahmananda's Wage -Goods Model
C) Harrod - Domar Growth Model D) Solow Growth Model
 
Answer & Explanation Answer: A) Mahalanobis Model

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian Economy

4 4923
Q:

The universal donor belongs to blood group

A) A B) B
C) AB D) O
 
Answer & Explanation Answer: D) O

Explanation:

The persons with 'O' blood group do not have antigens in the red corpuscles. So that blood will not cause agglutination of corpuscles if mixed with any type of blood. So group 'O' persons are called universal donors.

Report Error

View Answer Report Error Discuss

Filed Under: Biology

20 4923
Q:

The brain is covered by

A) meninges B) skin
C) bone D) all the above
 
Answer & Explanation Answer: D) all the above

Explanation:

The central nervous system ( brain and spinal card ) are invested with the meninges which nourish and protect the system .This again is enclosed inside a bony box which has the skin above it

Report Error

View Answer Report Error Discuss

Filed Under: Biology

14 4920
Q:

Tone, volume and pace are part of

A) Body language B) Spoken language
C) Sign language D) Written language
 
Answer & Explanation Answer: B) Spoken language

Explanation:

Tone, volume and pace are part of Spoken language.

Report Error

View Answer Report Error Discuss

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

3 4920
Q:

During Indian freedom struggle , a general strike jointly called by the Girni Kamgar Union and the Railway workers place in March, 1929 in bombay. This was actually in protest against ______

A) the congress acceptance of Domination Status to India as a desirable interim goal B) the visit to india of Whiteley commission on Labour
C) the Government's insistance on passing the Trade Disputes Bill through the Central Legislative Assembly D) the dismissal of workers who had taken part in the 1928 strikes
 
Answer & Explanation Answer: D) the dismissal of workers who had taken part in the 1928 strikes

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

4 4919