This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
VSMechatronics/Exercises/C7/string_with_gets.c

19 lines
359 B
C
Raw Permalink Normal View History

2022-04-08 15:12:38 +00:00
#include <stdio.h>
#include <stdlib.h>
int main()
{
// Declare variable - maximum 99 characters
char str[100];
// Prompt for text
printf("enter some text\n");
// Store intput in str
gets(str);
// Display a message on the screen
printf("you entered : %s\n", str);
// Exit from main
return 0;
}