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 does it mean when the linker says that _end is undefined?

1 Answers  


What are the basic data types associated with c?

1 Answers  


What 'lex' does?

1 Answers   Tech Mahindra,


C passes By value or By reference?

5 Answers   Geometric Software, Infosys,


discuss the steps needed to get a program from source code to executable in a system?

1 Answers  


can u suggest me am in a confusion to choose whether to go to c programming or a software testing . am a graduate in B.sc(electronics).

1 Answers  


In scanf h is used for

4 Answers   BFL,


Why is c called c?

1 Answers  


Are c and c++ the same?

1 Answers  


In C programming, what command or code can be used to determine if a number of odd or even?

1 Answers  


What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?

2 Answers  


is forign key will be unique key any table or not?

2 Answers  


Categories