Skip to content

Instantly share code, notes, and snippets.

@Lemmah
Created October 2, 2018 13:06
Show Gist options
  • Save Lemmah/6bd208a6de3f1be798170ff6ab61453d to your computer and use it in GitHub Desktop.
Save Lemmah/6bd208a6de3f1be798170ff6ab61453d to your computer and use it in GitHub Desktop.
This is the first C program
#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