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

How can variables be characterized?

0 Answers  


What is the meaning of && in c?

0 Answers  


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

0 Answers  


the data type used for unlimited value in c and how to do this program

1 Answers  


pgm to find middle element of linklist(in efficent manner)

4 Answers   Huawei,






How can I trap or ignore keyboard interrupts like control-c?

0 Answers  


What math functions are available for integers? For floating point?

0 Answers  


how to convert binary to decimal and decimal to binary in C lanaguage

7 Answers   BPO, Far East Promotions, IBM, RBS,


What is the right type to use for boolean values in c?

0 Answers  


The differences between Windows XP and Windows Visa

8 Answers   HCL,


Software Interview Questions

1 Answers   CAT,


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

0 Answers  


Categories