by CodeChum Admin
We’ve tried adding together integers, so how about adding characters as well? Well, we can’t do that with the knowledge we have now, so let’s use placeholders to do the trick!
Instructions:
Input
1. First character
2. Second character
Output
The first two lines will contain message prompts to input the two characters.
The last line contains the two characters together.
Enter·the·first·character:·A
Enter·the·second·character:·B
AB
#include <stdio.h>
int main() {
char ch1, ch2;
scanf("%c %c", &ch1, &ch2);
printf("%c%c\n", ch1, ch2);
return 0;
}
Comments
Leave a comment