Programming determines whether the input character is 'y' or 'Y', if yes, outputs 'yes', otherwise the output 'no'

#include<stdio.h>
void main()
{
char ch;
ch=getchar();
ch == 'y' || ch == 'Y' ? printf("yes") : printf("no");
}

 

 

Guess you like

Origin www.cnblogs.com/zhangdemingQ/p/12050821.html