move exercises, lecture examples, labs into subfolders
This commit is contained in:
20
Exercises/C7/string_with_scanf.c
Normal file
20
Exercises/C7/string_with_scanf.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user