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........................

Answers were Sorted based on User's Feedback



The code is::::: if(condition) Printf("Hello"); E..

Answer / hari nair

What 'bout this???

If(printf("Hello")
{
printf("Hello");
}
else
printf("World");


//printf returns the no. of arg printed, as no arg printed in if condition, goes straight to the else clause....

Is This Answer Correct ?    0 Yes 5 No

The code is::::: if(condition) Printf("Hello"); E..

Answer / suvam45

#include<stdio.h>
#include<conio.h>
main()
{
static int i;
if(i==0)
{
printf("HELLO");
i=i+1;
main();
}
else
prinf("WORLD");
getch();
}

Is This Answer Correct ?    5 Yes 13 No

The code is::::: if(condition) Printf("Hello"); E..

Answer / vaibhav

int a=5,b=5;
if(a==5)
printf("hello");
else;
printf("world");

Is This Answer Correct ?    4 Yes 28 No

The code is::::: if(condition) Printf("Hello"); E..

Answer / manjunath.goudar

//#include<stdio.h>
main()
{
if(1)
printf("hello");
else;
printf("world");
}

Is This Answer Correct ?    7 Yes 33 No

Post New Answer

More C Interview Questions

convert 0.9375 to binary

2 Answers   CTS, TANCET,


Why double pointer is used in c?

0 Answers  


Is struct oop?

0 Answers  


Can include files be nested?

0 Answers  


Determine if a number is a power of 2 at O(1).

2 Answers  


what is a far pointer

12 Answers   ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,


Can you think of a way when a program crashed before reaching main? If yes how?

2 Answers  


Why is it that not all header files are declared in every C program?

0 Answers  


is it possible to create your own header files?

0 Answers  


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

0 Answers   Wilco,


Why is conio.h not required when we save a file as .c and use clrscr() or getch() ?

2 Answers  


A program to write a number of letters and numbers, such as counting and display

0 Answers  


Categories