printf
Last updated
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *user_input;
user_input = argv[1];
// Replace any instances of the % character with a space
int i;
for (i = 0; i < strlen(user_input); i++) {
if (user_input[i] == '%') {
user_input[i] = ' ';
}
}
printf(user_input);
return 0;
}#include <stdio.h>
int main(int argc, char *argv[]) {
char *user_input;
user_input = argv[1];
// Write the user input to the terminal using the fputs() function
fputs(user_input, stdout);
return 0;
}#include <stdio.h>
int main(int argc, char *argv[]) {
char *user_input;
user_input = argv[1];
// Print the user input using the %s formatting command
printf("%s", user_input);
return 0;
}