Input three random characters and make sure they are inputted on different lines.
Print out the three characters in order, each on a different line, using only 1 printf() statement and newline characters (\n).
An initial code with the one printf() is provided for you, just complete the missing items inside it. Do not add any other printf()'s
#include <stdio.h>
#include <stdlib.h>
int main(){
char character1,character2,character3;
scanf("%c",&character1);
scanf("%c",&character2);
scanf("%c",&character2);
scanf("%c",&character3);
scanf("%c",&character3);
printf("%c\n%c\n%c\n",character1,character2,character3);
getchar();
getchar();
return 0;
}
Comments
Leave a comment