Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 7) Implemente o operador OU exclusivo.
- Por exemplo: Ler a informação se uma pessoa recebe vale alimentação (S/N) e se recebe
- auxilio transporte (S/N). Informar que a pessoa está regularizada se recebe um e somente
- um desses benefícios. */
- #include <stdio.h>
- int main(void)
- {
- char vale_a, aux_t;
- printf("Responda com S/s ou N/n se voce recebe vale alimentacao: ");
- scanf("%c", &vale_a);
- fflush(stdin); // retira os caracteres q estao armazenados na memoria do teclado
- printf("Responda com S/s ou N/n se voce recebe auxilio transporte: ");
- scanf("%c", &aux_t);
- if (((vale_a == 's'|| vale_a=='S') && (aux_t=='n' || aux_t=='N')) || ((vale_a=='n' || vale_a=='N') && (aux_t=='s' || aux_t=='S'))){
- printf("A pessoa esta regularizada");
- }
- else{
- printf("A pessoa nao esta regularizada");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment