Question #290047

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


Expert's answer

#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!

LATEST TUTORIALS
APPROVED BY CLIENTS