can we print any string without using terminator?

Answers were Sorted based on User's Feedback



can we print any string without using terminator?..

Answer / yogesh bansal

Yes, We can print the string without using the terminator.

like this

#include <stdio.h>

int main()
{
if(printf("this is yogesh"))
{
printf("then you must be good boy");
}
return 0;
}

Its a working example. when the control comes to if()
statement. first it will execute the printf statement inside
if() and the printf function will return number of character
printed which is an integer value and if() is true for any
value greater than 0. so it will go inside and execute the
rest of the code.

Hope the explanation is clear to you.

Is This Answer Correct ?    30 Yes 3 No

can we print any string without using terminator?..

Answer / ashutosh

the format should b like this

void main()
{
if(printf("i luv u deepa")
{
}
}

Is This Answer Correct ?    17 Yes 3 No

Post New Answer

More C Interview Questions

what is the different between if-else and switch statment (other than syntax)

26 Answers   CTS, Oracle, Scorpos,


Why c is known as a mother language?

0 Answers  


int i=10; printf("%d %d %d", i, i=20, i);

0 Answers  


Differentiate between full, complete & perfect binary trees.

0 Answers  


What is the most efficient way to count the number of bits which are set in an integer?

0 Answers  






how to reverse string "Hello World" by using pointers only. Without any temp var

1 Answers  


What is variable in c example?

0 Answers  


What are the types of bitwise operator?

0 Answers  


What is the difference between text files and binary files?

0 Answers  


what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason

3 Answers  


c program for searching a student details among 10 student details

0 Answers  


What is hashing in c?

0 Answers  


Categories