Skip to content

Instantly share code, notes, and snippets.

@idanarye
Last active May 9, 2016 18:59
Show Gist options
  • Save idanarye/eb21ba35750c3989dd29b4f067c7789b to your computer and use it in GitHub Desktop.
Save idanarye/eb21ba35750c3989dd29b4f067c7789b to your computer and use it in GitHub Desktop.
#include<stdio.h>
int main() {
double a, b;
int choice;
do {
printf("Enter two numbers: ");
scanf("%lf %lf", &a, &b);
printf("%lf / %lf = %lf\n", a, b, a / b);
printf("Do it again? ");
scanf("\n"); // We still have a newline character in the buffer...
scanf("%c", &choice);
} while (choice == 'y' || choice == 'Y');
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment