Re: Printing "hello , wolrd" with out using semicolon
From: Peter Nilsson (airia_at_acay.com.au)
Date: 05/11/04
- Next message: Ben Pfaff: "Re: if(a);"
- Previous message: Materialised: "Re: Another Understanding Pointers Question"
- In reply to: Arthur J. O'Dwyer: "Re: Printing "hello , wolrd" with out using semicolon"
- Next in thread: Richard Bos: "Re: Printing "hello , wolrd" with out using semicolon"
- Reply: Richard Bos: "Re: Printing "hello , wolrd" with out using semicolon"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Ben Pfaff: "Re: if(a);"
- Previous message: Materialised: "Re: Another Understanding Pointers Question"
- In reply to: Arthur J. O'Dwyer: "Re: Printing "hello , wolrd" with out using semicolon"
- Next in thread: Richard Bos: "Re: Printing "hello , wolrd" with out using semicolon"
- Reply: Richard Bos: "Re: Printing "hello , wolrd" with out using semicolon"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|