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

What is wrong with this statement? Myname = 'robin';

0 Answers  


When do we get logical errors?

0 Answers  


Which is better between malloc and calloc?

0 Answers  


What is the description for syntax errors?

0 Answers  


What is a program flowchart?

0 Answers  






What is use of #include in c?

0 Answers  


can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?

2 Answers  


How many parameters should a function have?

0 Answers  


main() { charx; while (x=0;x<=255;x++) printf("\nAscii value %d Character %c,x,x); }

2 Answers  


Give the logic for this #include<stdio.h> #include<conio.h> void main() { clrscr(); int a=10,b; b=++a + ++a; printf("%d", b); getch(); } Output: 24......How?

2 Answers   Accenture,


What are the various topologies? Which one is the most secure?

2 Answers  


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

0 Answers  


Categories