You are on page 1of 3

LAB 13

TASK 1:

#include<iostream>

#include <cstring>

#include<fstream>

using namespace std;

int main()

string str1,str2;

cout<<"Enter String1"<<endl;

cin>>str1;

cout<<"Enter String2"<<endl;

cin>>str2;

string *pointerstr;

pointerstr=&str1;

str1=*pointerstr+"modififed";

pointerstr=&str2;

str2=*pointerstr+"modififed";

cout<<endl<<str1<<endl;

cout<<endl<<str2<<endl;
LAB 13

TASK 2:

#include<iostream>

#include <cstring>

#include<fstream>

#include<conio.h>

using namespace std;

int main()

char str1[20];

cout<<"Enter String1"<<endl;

cin>>str1;

char *pointerstr;

pointerstr=str1;
LAB 13

int count=0;

while (*pointerstr != '\0') {

count++;

pointerstr++;

cout<<endl<<str1<<"has this count:"<<count;

You might also like