![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programmer
Join Date: Oct 2005
Location: India
Posts: 30
Rep Power: 0
![]() |
so the user can continually enter values until they get bored of it.
Try this out: #include<stdio.h> #define DAYS_IN_WEEK 7 main() { int loop,value,weeks,days; char y; clrscr(); do{ clrscr(); printf("Enter the days"); scanf("%d",&value); weeks=value / DAYS_IN_WEEK; days =value % DAYS_IN_WEEK; printf("%d days are %d weeks, %d days.\n", value, weeks, days); printf("Try another value:y/n"); scanf("%s",&loop); }while(loop=='y'|| loop=='Y'); } |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|