Skip to content

Instantly share code, notes, and snippets.

@karellism
Created March 3, 2019 23:28
Show Gist options
  • Save karellism/771e96bba63aba8702a23652d1f6a99a to your computer and use it in GitHub Desktop.
Save karellism/771e96bba63aba8702a23652d1f6a99a to your computer and use it in GitHub Desktop.
An example C code to read a string from STDIN and printing it out to STDOUT.
include <stdio.h>
int main()
{
char a[100]; //assuming that string size will not exceed 100
scanf("%s",a); //read a string in array a
printf("%s",a); //print out array a
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment