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
Do pointers take up memory?
What is #include stdio h?
what is different between auto and local static? why should we use local static?
What are 3 types of structures?
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.
Is main a keyword in c?
Is it better to use malloc() or calloc()?
What is the use of f in c?
Explain what is output redirection?
What is typedf?
How do I swap bytes?
How can I change the size of the dynamically allocated array?
What 'lex' does?
What is a dynamic array in c?
Explain how do you generate random numbers in c?