Ghislain_Mike

Ask name and print hello "name"

Mar 1st, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     char name[20]; // this is a string
  5.  
  6.     printf("What is your name? ");
  7.     gets(name); // scanf("%s", &name); // read(name)
  8.  
  9.     printf("Hello %s\n", name);
  10.  
  11.     return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment