Skip to content

Instantly share code, notes, and snippets.

@AaronHarris
Last active June 10, 2019 09:57
Show Gist options
  • Save AaronHarris/7fb766908749e0a689ea161162358ad6 to your computer and use it in GitHub Desktop.
Save AaronHarris/7fb766908749e0a689ea161162358ad6 to your computer and use it in GitHub Desktop.
Simple C program
#include <stdio.h>
int main()
{
int num1 = 0, num2 = 0, res1 = 0, res2 = 0;
printf("\nEnter num %% num: ");
scanf("%d %d", &num1, &num2);
res1 = num1 % num2;
res2 = num1 / num2;
printf("\nMod: %d\n", res1);
printf("Div: %d\n\n", res2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment