Course Solutions Uncategorized (Solved) : Given Long Long Integer Representing 10 Digit Phone Number Output Area Code Prefix Line Nu Q26267657 . . . .

(Solved) : Given Long Long Integer Representing 10 Digit Phone Number Output Area Code Prefix Line Nu Q26267657 . . . .

 

Given a long long integer representing a 10-digit phone number, output the area code, prefix, and line number, separated by hyphens. If the input is 8005551212, the output is: 800-555-1212 Hint: Use % to get the desired rightmost digits. Ex: The rightmost 2 digits of 572 is gotten by 572 % 100, which is 72. Hint: Use/ to shift right by the desired amount. Ex Shifting 572 right by 2 digits is done by 572/100, which yields 5. (Recall integer division discards the fraction). For simplicity, assume any part starts with a non zero digit. So 999-011.999 is not allowed. LAB ACTIVITY 2.22.1: CH2 LAB: Phone number breakdown 0 10 main.cpp Load default template.. 1 Rinclude clostrean 2 using namespace std 4 int main) ( S long long phoneNumber; 7cin > phonelunber 9Type your code here / 10 11 return ; 12 13Given

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post