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/LC7/ScanfString/scanf_string.c

24 lines
418 B
C
Raw Normal View History

2022-04-07 15:58:01 +00:00
/* EEEE1001/H61CAE - Chapter 7 */
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
char MyName[50]; /* Define a string of 50 characters */
/* Prompt for and read in a string */
printf("\nPlease enter your name & press return ");
scanf("%s",MyName);
/* Display fixed text and string on the screen */
printf("\nHello %s ",MyName);
return 0; /* End of the program */
}