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 is a list in c?
Can you explain the four storage classes in C?
What is pointer & why it is used?
Who invented bcpl language?
How do you list files in a directory?
What tq means in chat?
What happens if a header file is included twice?
What is the role of && operator in a program code?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
how to execute a program using if else condition and the output should enter number and the number is odd only...
Why double pointer is used in c?
How can you increase the size of a statically allocated array?
What are integer variable, floating-point variable and character variable?
How can I read a binary data file properly?
Does c have enums?