I'm new to coding so it could be a simple resolve, please bare with me.
I'm trying to create a program that will print Accepted when a letter of the alphabet it entered, excluding u. When u is entered it prints declined.
#include <stdio.h>
int main(void) {
char val;
printf("Enter your letter : \n");
val = scanf("%c", &val);
if (val == 'u' || (val >= '0' || val <= '9'))
printf("DECLINED\n");
else
print("ACCEPTED\n");
return (0);
}
Aucun commentaire:
Enregistrer un commentaire