We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# Spring 2010_CS201_3 Idea Solution

Spring 2010_CS201_3 Idea Solution
/*This is idea only, make this assignment by yourself, best of luck"*/
#include <iostream>
#include <cstring>
using namespace std;
main(){
char Directory[16],part1[3],part2[4], part3[7];
char *Tptr;
int size;
cout"Enter the complete phone number (as \"0092-123-1234567\") :";
cin>>Directory;
Tptr=strtok(Directory, "-");
while(Tptr!=NULL ){
coutTptr"\n";
size=strlen(Tptr);
switch(size){
case 4:
strcpy(part2, Tptr);
break;
case 3:
strcpy(part1, Tptr);
break;
case 7:
strcpy(part3, Tptr);
break;
}
Tptr=strtok(NULL,"-");
}
coutendl"Country Code is ="part2"\nCity code is ="part1"\n7-digit number is = "part3"\nPhone number in correct sequence is ="part2"-"part1"-"part3;
system("Pause");}

//Best of Luck, change this assignment
/*Solution 2==This is idea only, make this assignment by yourself, best of luck"*/
#include <iostream>
#include <cstring>
#include <string.h>
#include <conio.h>
using namespace std;
main(){
char Directory[16],part1[3],part2[4], part3[7], *Tptr;
int size;
cout"Enter the complete phone number :";
cin>>Directory;
Tptr=strtok(Directory, "-");
do{
size=strlen(Tptr);
switch(size){
case 4:
strcpy(part2, Tptr);
break;
case 3:
strcpy(part1, Tptr);
break;
case 7:
strcpy(part3, Tptr);
break;
}
Tptr=strtok(NULL,"-");
}while(Tptr!=NULL );
coutendl"Country Code is ="part2"\nCity code is ="part1"\n7-digit number is = "part3"\nPhone number in correct sequence is ="part2"-"part1"-"part3;
getch();}

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 95

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

its not working
stuck
few error is repoting
agar aap ko pata chal gya hai error hai to aap plzz is ko solve karne ki koshish karien ta k baaki sub log ka bhala ho jaye
fati
compelete solution 18 ko upload kr do ga it is easy .......... but make some change like as declarations comments ,spaces cout statments......... ok to get full mark .......
pls yaar sahi wala solution upload kr do jald az jald aur 18 se pehle hi kro do yaara hum sb ne bhi bnaani hai to hmme bhi waqt lgge ga bnnaane mein is lye 18 se pehle kr do.
really u have the right solution......if u have y donot u make it little change and display because after the dead line teacher will also upload solution then what will be big deal in that.ok
oooo bhai g last date 17 ha aur aap keh rahy ho k 18 ko solution dun ga aisa solution hum nay sir main mrna ha.....
18 last date hy aur bouns day bhi hay...........
while(Tptr!=NULL ){
coutTptr"\n";
size=strlen(Tptr);

yar is line main error day raha ha k "expected ; before sting constant"
error to samaj aa gaya ha but mughay is main kaheen kisi jaga pay colons miss nahi milay so can you please clear it.....

## Latest Activity

1 hour ago
1 hour ago
1 hour ago
1 hour ago
1 hour ago
+ ! ! ! ! ! ! Dîxîě Dûsť꧂ replied to ٹمبکٹو's discussion حاضری
1 hour ago
+ ! ! ! ! ! ! Dîxîě Dûsť꧂ liked ٹمبکٹو's discussion حاضری
1 hour ago
2 hours ago

1

2

3