I am writing a simple program with using getchar() and putchar() which outputs the next letter up in the alphabet from the input.
Here is my code :
If i input the letters abcde pressing enter in between each the output is -Code:#include <stdio.h> int main(void) { char c; printf("Enter letters: "); while((c = getchar()) != '0') { putchar(++c); } }
First of all, why are newline characters being outputted? Can this be stopped?Enter letters: a
b♂b
c♂c
d♂d
e♂e
f♂f
g♂g
h♂
Secondly, why does the '\n' character get incremented to '\v' aswell as the alphabet character?
Thankyou