Answer to Question #290047 in C for thilak

Question #290047

Write a C program to print the string and its length using functions


1
Expert's answer
2022-01-23T15:17:17-0500
#include <stdio.h>
#include <string.h>

int main() {
    char* str = "Hello, world!";

    printf("The string \"%s\" has length %d", str, strlen(str));

    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS