C examples for Statement:if
Use if statement to check user answer to the old yes-or-no question, case sensitive.
#include <stdio.h> int main()/*from w ww . j a v a2 s .c o m*/ { char c; printf("Would you like? Input y for yes and n for no"); c=getchar(); if(c=='N') { printf("Okay. \n"); } else{ printf("Bye!\n"); } return(0); }