answersLogoWhite

0

int main (void) {

char buf[1024];

scanf ("Enter a string: %s", buf);

printf ("The length of the string is %d chars long.\n", strlen (buf));

return 0;

}

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


How do you write a c program to find the smallest word in a string?

what is if(!(str[i]==32))


Write a c program using string concept enter a sting and replace the new string in to old string and find no of occurrence?

print c co com comp compu


Do I need to write a program to find a substring in a given string in c plus plus?

No.


What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


How do you find out the size of all the data types in C program?

sizeof is your friend.


Why and operator can not be used in string of c program?

Any character can be used in string, except for \\0. char example [] = "A&B|C";


C program plus copy of string to another?

strcpy


C plus plus program to perform string manipulation?

You do not need to program string manipulation as it is already part of the standard library. See std::string and std::wstring.


How do you Find size of a file using c program?

OS-dependent.stat for unix, FindFirstFile for Windows.


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


What is the program to create a string class which stores a string value in c plus plus?

C++ already provides a string class in the C++ standard template library. #include<iostream> #include<string> int main() { using namespace std; string s {"Hello world!"}; cout << s << endl; }