After getting user inputs the last prinft() is not printing at all

stuggling on my honework assignment

After I give inputs it stops rather than doing the random array and last print if anyone can help I qould appreciate it


int main()
char name, color;
int age;
int *poer = &age;
char *p = &name;
char *ptr = &color;
printf("What is your name?\n");
scanf(" %s", &name);
printf("How old are you??\n");
scanf(" %d", &age);
printf("What is your favorite color?\n");
scanf(" %s", &color);

char *story[5] = {"old volkswagen beetle","singlet","quater","left sock","blackberry bold ninek"};

printf("My pal right here %s is %d years old I feel like we have been coding together for a hundred 
years now I always wonder where the time has gone One thing I have wanted to know is why they love 
their %s %s so much I guess I might never know\n",name, age, color, story[rand()%5]);


return 0;


Read more here:

Content Attribution

This content was originally published by Erik 12345 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: