#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
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
English,
1 month ago
Science,
1 month ago
Social Sciences,
1 month ago
Chemistry,
2 months ago
Math,
2 months ago
Social Sciences,
9 months ago
Math,
9 months ago
English,
9 months ago