Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,104 questions

40,777 answers

573 users

How to convert bytes to MB in C++

1 Answer

0 votes
#include <iostream>

int main() {
    long bytes = 43839732;
    double mb = bytes / 1024.0 / 1024.0;
     
    std::cout << mb << " MB";
    
    return 0;
}
 
 
 
 
/*
run:
 
41.8088 MB
 
*/

 





answered Nov 5, 2021 by avibootz

Related questions

1 answer 66 views
66 views asked Nov 5, 2021 by avibootz
1 answer 32 views
32 views asked Aug 20, 2023 by avibootz
1 answer 26 views
26 views asked Aug 20, 2023 by avibootz
1 answer 22 views
...