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
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 |
Answer / vaibhav
int a=5,b=5;
if(a==5)
printf("hello");
else;
printf("world");
Is This Answer Correct ? | 4 Yes | 28 No |
Answer / manjunath.goudar
//#include<stdio.h>
main()
{
if(1)
printf("hello");
else;
printf("world");
}
Is This Answer Correct ? | 7 Yes | 33 No |
What is wrong with this statement? Myname = 'robin';
When do we get logical errors?
Which is better between malloc and calloc?
What is the description for syntax errors?
What is a program flowchart?
What is use of #include in c?
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?
How many parameters should a function have?
main() { charx; while (x=0;x<=255;x++) printf("\nAscii value %d Character %c,x,x); }
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?
What are the various topologies? Which one is the most secure?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions