Programming with Passion

Make the best out of everything.

Saturday 19 March 2016

Take computer file size in GB and display the size in bytes.

Take computer file size in GB and display the size in bytes.
/* (1GB=1024 MB, 1MB=1024 KB, 1KB=1024 bytes) */

#include
int main()
{
 int fileSizeInGb=0;
 int bytes=0;
 
 printf("Enter fileSizeInGb :");
 scanf("%d", &fileSizeInGb);
 bytes=fileSizeInGb*1024*1024*1024;
 printf("%d Gb in bytes=%d\n",fileSizeInGb,bytes);
 return 0;
}

No comments:

Post a Comment