Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

write a function to find whether a string is palindrome or not and how many palindrome this string contain?

2 Answers   Aptech,


Is array name a pointer?

0 Answers  


Differentiate between static and dynamic modeling.

0 Answers   Wipro,


what is the full form of c language

9 Answers   Satyam, TCS, VNC,


difference between spiral and waterfall model

1 Answers  






write an algorithm and c program to add two 2x2 matrics

2 Answers  


What is the use of typedef in structure in c?

0 Answers  


What's the difference between constant char *p and char * constant p?

0 Answers   Celstream,


21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

3 Answers  


print the pattern 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 if n=5

3 Answers   Winit,


plz let me know how to become a telecom protocol tester. thank you.

0 Answers  


what is reason of your company position's in india no. 1.

0 Answers   Accenture, TCS,






Categories