`
#include <stdio.h>
#include <string.h>
int main(void)
{
    int proceed,cipher;
    printf("Press 1 for decode and 0 to encode:- ");
    scanf("%i",&proceed);
    
    if (proceed)
    {
        char ciphertext[100];
        printf("Enter the cipher key:- ");
        scanf("%i",&cipher);
        printf("Enter CipherText:- ");
        scanf("%s",ciphertext);
        int len =  strlen(ciphertext);
        printf("Ciphertext:- ");
        for(int i = 0; i<len; i++)
        {
            if((ciphertext[i]) != ' ')
            {
                printf("%c", ciphertext[i]-cipher);
            }
            
        }
        printf("\n");
    }else{
        char plaintext[100];
        printf("Enter the cipher key:- ");
        scanf("%i",&cipher);
        printf("Enter PlainText:- ");
        scanf("%s",plaintext);
        int len =  strlen(plaintext);
        printf("Ciphertext:- ");
   
        for(int i = 0; i<len; i++)
        {
            if ((plaintext[i]) != ' ')
            {
                printf("%c", plaintext[i]+cipher);
            }
            
        }
        printf("\n");
    
    }
    return 0;
}
` But when i try to input sentences the program outputs only the first word. For example: when i input Press 1 for decode and 0 to encode:- 0 Enter the cipher key:- 2 Enter PlainText:- abc d Ciphertext:- cde and not ... Ciphertext:- cde f
I tried putting
if ((plaintext[i]) != ' ') into the program but it still gives the same output where the characters after the space doesnt give any output.
