The code is::::: if(condition)
Printf("Hello");
Else
Printf("World");
What will be the condition in if in such a way that both
Hello and world are printed in a single attempt?????? Single
Attempt in the sense... It must first print "Hello" and it
Must go to else part and print "World"..... No loops,
Recursion are allowed........................

Answer Posted / srikanth

int main()
{
if(fork())
{
printf("hello");
}
else
{
printf("world");
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c language is called c?

748


Is there sort function in c?

789


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

1612


What are global variables?

871


What are the 5 types of inheritance in c ++?

768


What is a good way to implement complex numbers in c?

800


What are the types of assignment statements?

828


How can I swap two values without using a temporary?

836


What is switch in c?

849


Define circular linked list.

789


Why is #define used?

1016


Why clrscr is used in c?

793


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

989


What happens if a header file is included twice?

799


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

907