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

What is the size of enum in bytes?

820


In C language, a variable name cannot contain?

1034


What is a program?

946


What is echo in c programming?

768


When can you use a pointer with a function?

775


Why are all header files not declared in every c program?

844


How to get string length of given string in c?

829


What is identifier in c?

789


What is the correct code to have following output in c using nested for loop?

858


write an algorithm to display a square matrix.

2465


What is pointers in c?

921


What is the use of gets and puts?

796


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

846


difference between Low, Middle, High Level languages in c ?

1873


Explain how can I make sure that my program is the only one accessing a file?

938