can we print any string without using terminator?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between arrays and pointers?

573


Can you think of a logic behind the game minesweeper.

1994


What are the features of c language?

611


what are # pragma staments?

1615


What is sizeof int?

627






What is non linear data structure in c?

559


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1732


Give me the code of in-order recursive and non-recursive.

871


How #define works?

603


What does the error message "DGROUP exceeds 64K" mean?

718


Not all reserved words are written in lowercase. TRUE or FALSE?

712


Is javascript based on c?

585


Why can’t we compare structures?

801


What does %p mean c?

613


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

652