Last active
September 9, 2023 09:38
-
-
Save sats17/33ff2975d7787b01fbb3c9a205b3e11c to your computer and use it in GitHub Desktop.
Dump-gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> // Include a library that provides input/output functions | |
// By default C runs main function from compiler | |
int main() { | |
char name[100]; // Declare a variable named 'name' that can hold up to 99 characters plus a null terminator | |
printf("Enter your name: "); // Print a message asking for input | |
scanf("%s", name); // Read a string of characters (input) and store it in the 'name' variable | |
printf("Hello, %s!\n", name); // Print a greeting message with the entered name | |
return 0; // Indicate that the program has completed successfully | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment