Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main()
- {
- int n=10;
- char yesno[3];
- do
- {
- printf("\n%s", "Do you want to play by defaut dimensions(10X10)?(yes/no)");
- scanf("%s", &yesno);
- if ((yesno!="yes")&&(yesno!="no"))
- {
- printf("\n%s", "Wrong input.Please choose between default dimensions(yes) and custom dimensions(no)");
- }
- }while ((yesno!="yes") && (yesno!="no"));
- if (yesno=="no")
- {
- do
- {
- printf("\n%s", "Choose your own dimensions");
- scanf("%d", &n);
- if (n<5)
- {
- printf("\n%s", "Wrong input.Please choose a number >=5");
- }
- }while(n<5);
- }
- printf("\n%d", n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement