Created
October 2, 2018 13:06
-
-
Save Lemmah/6bd208a6de3f1be798170ff6ab61453d to your computer and use it in GitHub Desktop.
This is the first C program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
int value = 0; | |
char message; | |
printf("Input a number:"); | |
scanf("%d", &value); | |
if (value % 5 == 0) { | |
if (value % 3 == 0) { | |
message = 'Z'; | |
} else { | |
message = 'B'; | |
} // Divisible by 5 & 3 | |
} else if (value % 3 == 0) { | |
message = 'F'; | |
} else { | |
message = 'N'; | |
} | |
printf("%c", message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment