Due Date 18 May 2010View more random threads:
- STA301 Solution of the First Assignment solution Fall2010
- CS301 Data Structure VU Current Assignment No. 1 semester...
- MGT611 First Assignment idea solution October, fall 2012
- MTH202 Assignment No 2 Solution May 13,2010
- Assignment No. 03 Semester Fall 2010 Human-Computer...
- All Past Assignments with Solutions Of STA630 Research...
- Assignment No.2 (Course STA301) Spring 2010 May 4
- MTH302 Business Mathematics & Statistics Assignment 2
- CS301-Data Structures Assignment No.3 Fall 2014 Due Date...
- MTH202 Assignment 6 Deadline 30 July 2010
Problem Statement: Recognizing and Splitting the string.
You are required to write a program that takes a phone number as input from the user and stores it as a string value. The phone number will consist of country code, city code and actual 7-digit number separated by “-”. User can enter the phone number in any order. Your program should be able to recognize the country code, city code and 7-digit number and display it in the following format.
Country code - City code – 7-digit number
Detailed Description:
1. Take phone number as input from the user.
2. The number should be stored as a string value.
3. User can enter the phone number in any order for example 0092-333-1234567 or 333-0092-1234567 or 1234567-333-0092 etc.
4. Program should be able to recognize country code, city code and 7-digit number from the string and display it in the right sequence.
Sample Output 1
Enter the complete phone number : 0092-1234567-333
Country code is = 0092
City code is = 333
7-digit number is = 1234567
Phone number in correct sequence is = 0092-333-1234567
Sample Output 2
Enter the complete phone number : 1234567-321-0092
Sponsored Links
Country code is = 0092
City code is = 321
7-digit number is = 1234567
Phone number in correct sequence is = 0092-321-1234567
Sample Output 3
Enter the complete phone number : 300-0092-9876543
Country code is = 0092
City code is = 300
7-digit number is = 9876543
Phone number in correct sequence is = 0092-300-9876543
HINTS:
You can split the string into three parts and store each part as different string.
You should use strtok, strlen, and strcat functions for solving this assignment.
:o:o--------------------------------------------------------------------------------------:o:o
[B]The more knowledge you have, the greater will be your fear of Allah.[/B]
Please Join My [B]Group Vuhelp[/B][B], Birthday Wishing, Daily Hadees[/B] [CODE][B]http://vuhelp.net/groups/vuhelp.html[/B]
[B]http://vuhelp.net/groups/birthday-wishing.html[/B]
[B]http://vuhelp.net/groups/daily-hadees.html[/B][/CODE]
[CENTER][B][COLOR="Red"][SIZE="4"]Email: [email]viki@vuhelp.net[/email][/SIZE][/COLOR][/B][/CENTER]
There are currently 1 users browsing this thread. (0 members and 1 guests)