complete assignment01
This commit is contained in:
5 files changed
+187
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define MEGABYTES_TO_MEGABITS 8
|
||||
|
||||
int main(void) {
|
||||
float downloadSpeedMbs;
|
||||
float fileSizeMB;
|
||||
float downloadTimeSeconds;
|
||||
|
||||
printf("Enter download speed (Mbs): ");
|
||||
scanf("%f", &downloadSpeedMbs);
|
||||
|
||||
printf("Enter file size (MB): ");
|
||||
scanf("%f", &fileSizeMB);
|
||||
|
||||
downloadTimeSeconds = (fileSizeMB * MEGABYTES_TO_MEGABITS) / downloadSpeedMbs;
|
||||
|
||||
printf(
|
||||
"At %.2f megabits per second, a file of %.2f megabytes downloads in %.2f seconds.\n",
|
||||
downloadSpeedMbs,
|
||||
fileSizeMB,
|
||||
downloadTimeSeconds
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user