Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

lisphhh

Name: Anonymous 2010-03-05 12:46

So how do you write a command line program that asks the user for his name and then says "Hello %name%!" in Lisp?

Name: Anonymous 2010-03-06 20:34

#include <stdio.h>

int main (void)
{
    char name[100];
    int x, endl;
   
    printf ("Enter you're name: ");
    for (x = 0; (scanf ("%c", &name[x])), name[x] != '\n'; x++);
    endl = x;
   
    printf ("Hey there ");
   
    for (x = 0; x < endl; x++)
        printf ("%c", name[x]);
   
    printf (", you silly goose!");
   
    return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List