小编J T*_*J T的帖子

C语言是或否如果带有char的语句?

#include <stdio.h>
int main(void)
{
    char fever, cough; /*Sets the chars.*/

    printf("Are you running a fever? (y/n)\n"); /*Asks if they have a fever and saves their input.*/
    scanf("%c",&fever);

    printf("Do you have a runny nose/cough? (y/n)\n"); /*Asks if they have a cough and saves their input.*/
    scanf(" %c",&cough);

    printf("Please verify the folling information.\nFever: %c \nRunny nose/cough: %c \n",fever,cough); /*Asks if the following info is correct.*/


    if ((fever=y) && (cough=y))
    printf("Your recommendation is to see a doctor.");

    else if ((fever=n) && (cough=y)) …
Run Code Online (Sandbox Code Playgroud)

c if-statement char

0
推荐指数
1
解决办法
7万
查看次数

标签 统计

c ×1

char ×1

if-statement ×1