Conditional loop

Tuesday, October 14, 2014
/* 0704.c: Conditional loop */
#include <stdio.h>

main()
{
    int c;

    printf("Enter a character:\n(enter x to exit)\n");
    for ( c=' '; c != 'x'; ) {
        c = getc(stdin);
        putchar(c);
    }
    printf("\nOut of the for loop. Bye!\n");
    return 0;
}

Copyright @ 2015 Tron!

Labels

Blog Archive