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 to find your architecture is LittleEndian or BigEndian?

1 Answers  


Can we change the value of #define in c?

0 Answers  


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

0 Answers  


Why c is called top down?

0 Answers  


What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value.

11 Answers   TCS,






Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 Answers  


How do you redirect a standard stream?

0 Answers  


what is the difference between : func (int list[], ...) or func (int *list , ....) - what is the difference if list is an array and if also if list is a pointer

2 Answers  


Is it possible to have a function as a parameter in another function?

0 Answers  


What is calloc()?

0 Answers   Adobe,


main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }

1 Answers  


Should a function contain a return statement if it does not return a value?

0 Answers  


Categories