Last active
May 9, 2016 18:59
-
-
Save idanarye/eb21ba35750c3989dd29b4f067c7789b to your computer and use it in GitHub Desktop.
This file contains 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> | |
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