HelloWorld never!

Hello OR World, but never both at the same time!

If "condition" yields a ZERO OR ITS EQUIVALENT, then you may say 
it's NOT fulfilled.

If "condition" yields ANYTHING ELSE THAN ZERO OR ITS EQUIVALENT, 
then you may say it's TOTALLY fulfilled.

char s[6]="Jugal"; // The null character is at the end, s[6]

if (s[6])
cout << "ANYTHING ELSE THAN ZERO";
else
cout << "ZERO"; // Prints ZERO

if (*(s+6))
cout << "ANYTHING ELSE THAN ZERO";
else
cout << "ZERO"; // Prints ZERO

if (-1.23456)
cout << "ANYTHING ELSE THAN ZERO"; // Prints ANYTHING ELSE THAN ZERO
else
cout << "ZERO";

Best,

Geraldo


--- In [email protected], "jugal_panchal" <[EMAIL PROTECTED]> 
wrote:
>
> what is condition so we will get HelloWorld output in following 
code
> 
> if "condition"
> printf("Hello");
> else
> printf("World");
>


Reply via email to