en | es

c html css js php python ruby web server


What's your name?


Donwload

~> gcc -c name name.c

~> ./name

~> Please enter your name: My_Name

~> Your name is My_Name


        
/* Include files */
#include "stdio.h"

/* Main function */
int main ()
{
  /* Declare vars */
  /* More than 30 characters will throw an error */
  char name[30];

  /* Ask */
  printf("Please enter your name:");
  /* Wait the name */
  scanf("%s", name);

  /* Screen output */
  printf("Your name is %s\n", name);
  return 0;
}
        
      

Copyright © DevLangs.org.