What is the largest mass that can be measured in the balance
Solved
Show answers
More tips
- S Science and Technology Exploring Our Galaxy: How Many Planets are in the Milky Way?...
- W Work and Career Can Skill Alone Make You a Professional?...
- C Computers and Internet How to Top Up Your Skype Account Without Losing Money?...
- P Philosophy Unidentified Flying Object - What is the Nature of this Phenomenon?...
- F Family and Home Protect Your Home or Apartment from Pesky Ants...
- O Other What is a Disk Emulsifier and How Does it Work?...
- F Family and Home What does a newborn need?...
- F Family and Home Choosing the Right Car Seat for Your Child: Tips and Recommendations...
- F Food and Cooking How to Get Reconfirmation of Registration?...
Answers on questions: Chemistry
- C Chemistry Explain why some regions in Canada or the United States may be more susceptible to the effects of acid rain...
- C Chemistry Meeting ID: 979 0941 2169 Passcode: 0qbXUE...
- C Chemistry 32.5grams of NaOH (sodium hydroxide) reacts an excess of CO2 (carbon dioxide) 2NaOH(s) + CO2(g) → Na2CO3(s) + H2O What is the theoretical yield of Na2CO3 in grams? b. If 16.45...
- C Chemistry What two factors contribute to the formation of deep sea currents?...
- C Chemistry Label the molecular shape around each of the central atoms in the amino acid glycine. hint...
- H History What is nigeria s government like today? a. communist b. aristocratic c. authoritarian d. democratic...
- P Physics What quantity describes the difference between an object���s initial position and the object���s final position?...
- B Biology The kidneys do not play a vital role in regulating:...
- P Physics How did humans decide how long a year should be...
- H History Why did the london company send settlers to virginia...
Ответ:
Ответ:
#include <iostream>
using namespace std;
int main() {
int n, reversedNumber = 0, remainder;
cout << "Enter a number: ";
cin >> n;
int length = to_string(n).length();
if (length == 4){
while(n != 0) {
remainder = n%10;
reversedNumber = reversedNumber*10 + remainder;
n /= 10;
}
cout << "Reversed Number = " << reversedNumber << endl;
}
else{
cout << "Invalid Input!" << endl;
}
return 0;
}
Explanation:
So, it's pretty easy. It finds the remainder to reverse the number and for the invalid input part, you convert the input into a string and then use .length() to find the length. Then you can reverse the number and show whatever output