Re: Printing "hello , wolrd" with out using semicolon

From: Peter Nilsson (airia_at_acay.com.au)
Date: 05/11/04


Date: 10 May 2004 17:59:09 -0700


"Arthur J. O'Dwyer" <ajo@nospam.andrew.cmu.edu> wrote in message news:<Pine.LNX.4.58-035.0405101339250.7614@unix40.andrew.cmu.edu>...
> On Mon, 10 May 2004, Yakov Lerner wrote:
> >
> > b_prashanth@hotmail.com (Prashanth Badabagni) wrote:
> > > Can anybody tell me how to print "hello,world" without using semicolon
> >
> > Here is a variation: write C program to print ";"
> > without using semicolon, digits, double quote, and single quote.
> > Assume ascii.
>
> ASCII is off-topic in comp.lang.c. I think you meant to say,
> "Do not assume ASCII."
>
> #include <stdio.h>
> #include <stdlib.h>
> #define Z ((int)NULL)
> #define P(x) printf(#x
> #define L(x) #x
> #define S L(| |)[!Z]
> int f(int l,int i){if((i=l,!Z)&&l==Z&&P(%c%c%d\n),S,S,Z)&&f
> (++i,i)){}else if(--l==Z&&P(\n))&&f(++i,i)){}else if(--l==Z

The \ in \n is not at the end of a line, not part of a character or
string literal, not part of a universal character, not part of an
include header, and does not constitute a punctuator or other
preprocessor token.

I know gcc does not issue a diagnostic, but unless I'm missing
something, it's a syntax error.

> &&P(%c%c%d\n),S,S,Z)&&f(++i,i)){}else if(--l==Z&&P(%c/\n),S
> )&&f(++i,i)){}else if(exit(Z),Z){}}int main(){if(f(Z,Z)){}}

-- 
Peter


Relevant Pages

  • Re: Printing "hello , wolrd" with out using semicolon
    ... > without using semicolon, digits, double quote, and single quote. ... It also assumed ASCII. ...
    (comp.lang.c)
  • Re: Printing "hello , wolrd" with out using semicolon
    ... > without using semicolon, digits, double quote, and single quote. ... ASCII is off-topic in comp.lang.c. ...
    (comp.lang.c)
  • Re: Printing "hello , wolrd" with out using semicolon
    ... without using semicolon, digits, double quote, and single quote. ... Assume ascii. ... Yakov ...
    (comp.lang.c)
  • Re: Sort ignores apostrophe
    ... If the database is really large, this would be a reason to move to MSDE. ... > Could you use the Replacefunction to replace the single quote with a ... >> is specifically excluded from a sort in SQL. ... >> double quote = ASCII 34 ...
    (microsoft.public.access.queries)
  • Re: Sort ignores apostrophe
    ... Could you use the Replacefunction to replace the single quote with a ... > is specifically excluded from a sort in SQL. ... > before Oates but O'Dea comes after. ... > double quote = ASCII 34 ...
    (microsoft.public.access.queries)