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

Why can't I perform arithmetic on a void* pointer?

635


What is c language in simple words?

588


Write a program to show the change in position of a cursor using c

575


What is the acronym for ansi?

626


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

612






When the macros gets expanded?

781


What is the meaning of 2d in c?

607


write a program to rearrange the array such way that all even elements should come first and next come odd

1758


Should I learn data structures in c or python?

576


What's a good way to check for "close enough" floating-point equality?

621


What is a pointer on a pointer in c programming language?

617


Explain the advantages of using macro in c language?

573


What is the translation phases used in c language?

628


How many bytes is a struct in c?

721


Why is python slower than c?

600