Answer the question
In order to leave comments, you need to log in
How to insert another word between words in typed text?
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_NONSTDC_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <string.h>
int main(void)
{
char text[20];
gets(text);
printf("%s",text);
return 0;
}
Answer the question
In order to leave comments, you need to log in
The given code... is not ideal. I'll close my eyes to the code and give you an idea.
The carriage return character \r
moves the output to the beginning of the last line, while further output goes on top of it , which is what we want. So: we read the string, we change it as we please, we output \r
, we output the modified string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question