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 / anudyuti
#include <stdio.h>
int executeboth();
void main()
{
both();
}
int both()
{
static int i=0;
if(i++==0 ? executeboth():1)
{
printf ("Hello");
}
else
{
printf (" World");
}
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the uses of null pointers?
What does %c mean in c?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Why is structure padding done in c?
What does 1f stand for?
Explain zero based addressing.
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
How are strings stored in c?
Is c++ based on c?
What is union and structure?
What is the difference between null pointer and wild pointer?
List some applications of c programming language?
Why double pointer is used in c?
Explain heap and queue.
How can I read data from data files with particular formats?