Computer Science, asked by mammootty9292, 7 hours ago

#include <iostream>
#include<cstring>
using namespace std;
int main()
{ string r;
cout<<"Enter some words: ";
cin>>r;
char c[]="r";
int a;
a= strlen(c);
cout<<a;
}
1 is getting as answer.correct it​

Answers

Answered by michaelgari032
0

Answer:

Explanation:

Correct:

#include<bits/stdc++.h>

using namespace std;

int main()

{  

string r;

cout<<"Enter some words: ";

cin>>r;

//converting string to char

int n = r.length();

char c[n + 1];

strcpy(c, r.c_str());

int a = strlen(c);

cout<<a;

}

Similar questions