How to output strings in the C language?
In C language, the printf function can be used to display strings.
For example, to print the string “Hello, World!”, you can use the following code:
#include <stdio.h>
int main() {
char str[] = "Hello, World!";
printf("%s", str);
return 0;
}
Use the %s format specifier in the printf function to output a string.