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

proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?

7 Answers   Hughes,


What are predefined functions in c?

0 Answers  


define switch statement?

6 Answers   CTS,


write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4

9 Answers   IBM, NIIT, Winit,


what is pointer?

13 Answers   HCL, TCS,


what is output? main() { #define SQR(x) x++ * ++x int i = 3; printf(" %d %d ",SQR(i),i * SQR(i)); } a)9 27 b)35 60 c)20 60 d)15 175

5 Answers   Wipro,


read a number & print all its devisors using c-program?

3 Answers  


Can you write the function prototype, definition and mention the other requirements.

0 Answers   Adobe,


Explain the properties of union.

0 Answers  


What is time null in c?

0 Answers  


Why is it that not all header files are declared in every C program?

0 Answers  


write a program to display numbers from 1 to 10 and 10 to 1?

2 Answers  


Categories