Following program to read a string value and then displays its length. Write the missing line of this program. 1 #include <stdio.h> 2 #include < 3 void main() 4 { 5 char c[20]; 6 printf("Enter string: "); 7 gets(c); 8 printf("Length of string c = %d \n", ______(c)); 9} Enter string: Yanbu Length of string c=5 include < printf("Length of string c = %d \n", (c));
Added by Julia R.
Close
Step 1
We need to include the necessary header files: #include <stdio.h> #include <string.h> Show more…
Show all steps
Your feedback will help us improve your experience
Gokul R Nair and 50 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program in C++ to Find the Length of a String
Sanchit J.
What is the output of this C code? #include <stdio.h> struct student { int no; char name[20]; }; void main() { struct student s; s.no = 8; printf("hello"); }
Amaad M.
Write a function in C++ that returns the count of a string's suffix in a given string, S. A suffix is a combination of one or more symbols appended at the end of the string. You will be given the length, L, of the suffix as a parameter to the function. Constraints: - S does not contain newline characters - Length(S) >= L > 0 Template: ```cpp #include <iostream> #include <string> int suffixCount(std::string S, int L) { // Your code here } ``` Sample Input: ``` et tu, brute 1 ``` Sample Output: ``` 2 ```
Supreeta N.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD