I'm trying to store three characters in an array and then print all three what is wrong with this?
here's the code:
#include <stdio.h>
char array[3];
int main()
{
int x;
printf("Please enter your first initial\n");
scanf("%c",&array[0]);
printf("Please enter your second initial\n");
scanf("%c",&array[1]);
printf("Please enter your third initial\n");
scanf("%c",&array[2]);
printf("Your initials are: ");
for(x=0;x<3;x++)
{
printf("%c", array[x]);
}
return 0;
}