Remove the spaces using getchar/putchar

PHOTO EMBED

Wed May 08 2024 04:12:12 GMT+0000 (Coordinated Universal Time)

Saved by @Saging

#include <stdio.h>
#include <ctype.h>

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')
    
    if (isalnum(c)) {
        putchar(c);
    } else
    if (ispunct(c)) {
        putchar(c);
    }
    return 0;
}
content_copyCOPY