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

explain how do you use macro?

0 Answers  


Difference Between embedded software and soft ware?

1 Answers   Bosch,


How can I allocate arrays or structures bigger than 64K?

5 Answers  


Why is C language being considered a middle level language?

0 Answers  


how many key words availabel in c a) 28 b) 31 c) 32

0 Answers  






how do you programme Carrier Sense Multiple Access

0 Answers  


#include <stdio.h> void main() { int i=-1,j=1,k,l; k=!i&&j; l=!i||j; printf ("%d%d",k,l) ; }

3 Answers   SRG,


What is data types?

0 Answers  


Explain how can you determine the size of an allocated portion of memory?

0 Answers  


What are runtime error?

0 Answers  


What is the difference between macros and inline functions?

5 Answers   Global Edge, L&T,


What is the difference between File pointer and Internal Charecter Pointer?

2 Answers   TATA,


Categories