Nov 6, 2010

Find out the no. of words.

How many words can be formed by using all the letters of the word "DAUGHTER"
so that the vowels always come together?


Answer:
4320

Explanation:
Given word contains 8 different letters.When the vowels AUE are always together
We may suppose them to form an entity,treated as one letter.

Then,the letters to be arranged are DGHTR(AUE).

These 6 letters can be arranged in 6P6=6!=720 ways
The vowels in the group (AUE) may arranged in 3!=6 ways.
therefore Required number of words=(720 X 6)=4320.

Find the output.

void main()
{
static int i=5;
if(--i)
{
main();
printf("%d ",i);
}
}


Output: 
0 0 0 0


Explanation:
The variable 'i' is declared as static, hence memory for 'i' will be allocated
for only once, as it encounters the statement. The function main() will be called
recursively unless 'i' becomes equal to 0, and since main() is recursively called, so
the value of static 'i' ie., 0 will be printed every time the control is returned.