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


Please Help Members By Posting Answers For Below Questions

Do pointers take up memory?

645


What is #include stdio h?

673


what is different between auto and local static? why should we use local static?

630


What are 3 types of structures?

584


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1976






Is main a keyword in c?

619


Is it better to use malloc() or calloc()?

639


What is the use of f in c?

548


Explain what is output redirection?

657


What is typedf?

659


How do I swap bytes?

620


How can I change the size of the dynamically allocated array?

621


What 'lex' does?

709


What is a dynamic array in c?

585


Explain how do you generate random numbers in c?

612