plz give the code for the question
Attachments:
Aips:
Can u rewrite the following question.
#include<stdio.h>
using namespace std;
int main()
{
char a[30];
int i;
cout<<"Enter a string:";
gets(a);
for(i=0;a[i]!='\0';++i);
cout<<"\nLength of the string '"<<a<<"' is "<<i;
return 0;
}
Error for being out of range array size or you are trying to access a null space of memory.
I hope that my answer, it is suitable for your problem..
Answers
Answered by
0
What code? Theres no code for this
Answered by
1
#include<iostream>
using namespace std;
int main()
{
int user;
char text[25];
cout << "Enter a readable string";
cin.getline(text,25);
while(text[user] != '\0')
{
user++;
}
cout << "\n The length of the string is :" << user;
return 0;
}
Hope this helps!
using namespace std;
int main()
{
int user;
char text[25];
cout << "Enter a readable string";
cin.getline(text,25);
while(text[user] != '\0')
{
user++;
}
cout << "\n The length of the string is :" << user;
return 0;
}
Hope this helps!
Attachments:
Similar questions
Science,
8 months ago
Math,
8 months ago
English,
8 months ago
History,
1 year ago
Computer Science,
1 year ago
Hindi,
1 year ago
Environmental Sciences,
1 year ago