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/C7/string_with_scanf.c

20 lines
366 B
C
Raw Normal View History

2022-04-08 15:12:38 +00:00
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
// Declare some variables
char name[50];
// Wait for a kepypress, store result in c
printf ("Please enter your name");
// read in using scanf with %s
scanf ("%s",name);
// Display on the screen using printf
printf ("Hello %s\n", name);
// Exit from main
return 0;
}