puts without newline c
The puts
function in C is used to output a string to the standard output (usually the console) followed by a newline character. If you want to use puts
without the newline character, you can simply use the printf
function instead. The printf
function allows you to format and print text in C, and you can use it to print a string without a newline character by using the %s
format specifier. Here's an example:
#include <stdio.h>
int main() {
char str[] = "Hello, world!";
printf("%s", str);
return 0;
}
This will output the string "Hello, world!" without a newline character at the end.