C examples for Language Basics:scanf
Type your name at the keyboard and then have the computer display your name on the screen, along with friendly greeting
#include <stdio.h> int main()//from www . j a va 2s . c o m { char me[20]; printf("What is your name?"); scanf("%s",&me); printf("Darn glad to meet you, %s!\n",me); return(0); }