81.0k views
4 votes
Write a program that reads values representing the weight in kilograms, grams, and milligrams and then prints the equivalent weight in milligrams

User JLundell
by
7.4k points

1 Answer

0 votes
long kg,g,mg;
cin >> kg>> g >> mg;
cout << kg*1000000+g*1000+mg;

User Sergio Bernal
by
7.1k points