-1
#include <stdio.h>
int main (){
char sangue, nome[30];
printf("Informe nome:\n");
scanf("%s",& nome);
printf("Informe o sangue de acordo com a tabela\n");
printf("|--------+-------+|\n");
printf("| A (x) | A- (w) |\n");
printf("|-------+--------+|\n");
printf("| B (p) | B- (y) |\n");
printf("|-------+--------+|\n");
printf("| AB (t)| AB- (z) |\n");
printf("|-------+--------+|\n");
printf("| O (o) | O- (k) |\n");
printf("+-------+---------+\n");
scanf("%s",& sangue);
switch(sangue){
case'x':
printf("Sr(a) %s seu sangue e A+");
break;
case'w':
printf("Sr(a) %s seu sangue e A-");
break;
case'p':
printf("Sr(a) %s seu sangue e B+");
break;
case'y':
printf("Sr(a) %s seu sangue e B-");
break;
}
return 0;
}
Swap scanf("%s",& blood); for scanf("%c",& blood); as it is a single character and not a string. And here: scanf("%s",& name); switch to: scanf("%s", name); as it is a string. This is not the indentation normally used in a switch/case.
– anonimo