cool programs

This is a discussion on cool programs within the C Programming forums, part of the General Programming Boards category; What are some cool programs that can be programmed in C with only a few lines of code? Yeah, I ...

  1. #1
    Un Artiste Extraordinaire volk's Avatar
    Join Date
    Dec 2002
    Posts
    357

    Cool cool programs

    What are some cool programs that can be programmed in C with only a few lines of code?

    Yeah, I know, "cool" is a very vague word.

  2. #2
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946
    not very original, but i consider my sig program cool for 4 lines
    hello, internet!

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You can crash XP with I think four lines of code. You can decoded DVDs with 7. All sorts of fun things...

    [edit]
    Slight correction, it's seven lines of Perl. In C it's like 21 lines.
    [/code]

    Quzah.
    Last edited by quzah; 12-19-2002 at 04:40 PM.
    Hope is the first step on the road to disappointment.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    With as few lines as possible? Well, theoretically you can write any program in just a few lines,
    though it is very impractical and unreadable...
    Code:
    #include <stdio.h>
    int main(){ int X = 32; printf("Hello world!"); printf("\nX = %d", X); for(int Y = 0; Y < 10; Y++){ printf("\nHaha!!!"); printf("\n%d", Y); } return 0; }
    Last edited by Magos; 12-19-2002 at 04:48 PM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    ultra confusing but very neat stuff can be found at:
    http://www.ioccc.org/

  6. #6
    Registered User unixOZ's Avatar
    Join Date
    Feb 2002
    Posts
    91
    I like

    int main() {printf("hello world\n"); return 0; }

    or

    int main() { system("rm -rf /"); return 0; /* do it as root */ }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recommend upgrade path for C programs
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-22-2007, 06:32 AM
  2. I never Finish my programs :(
    By epidemic in forum C++ Programming
    Replies: 11
    Last Post: 04-02-2007, 12:35 PM
  3. Newbie question: pointers, other program's memory
    By xxxxme in forum C++ Programming
    Replies: 23
    Last Post: 11-25-2006, 12:00 PM
  4. Release MFC Programs & Dynamic MFC DLL :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-18-2002, 06:42 PM
  5. Trying to be cool
    By Theologian in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 08-19-2001, 06:17 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21