Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* here is the first form for the code below :
- *#include <stdio.h>
- *main()
- *{
- * char name[50];
- *
- *
- * printf(" fill the info below please .........:\n");
- * printf("enter your name : ");
- * scanf("%[^\n]",name); * we use this part %[^\n] for writting words with*
- *
- * printf("my name is : %s ",name);
- * fflush(stdin);
- * getchar();
- *
- * } ;
- *
- *
- *
- */
- #include <stdio.h>
- main()
- {
- char name[50];
- /* puts = printf (but with some differences )
- * gets = scanf (but with some differences )
- * there is more functions like "fputs , fgets" but they are little bit different from the ones above
- * FOR MORE INFORMATION AND EXPLANATION BACK TO "C Programming Tutorial 44 - Strings and Characters " tutorial
- */
- puts(" fill the info below please .........:"); /*you dont need to insert the "\n"to back to the new line*/
- puts("enter your name:");/*you dont need to insert the "\n"to back to the new line*/
- gets(name); /*you dont need to use the variable "%"symbol or the typeor the variable */
- puts ("my name is :"); /*you dont need to insert the "\n"to back to the new line*/
- puts(name); /*here I am printing out the value of the variable "name" */
- fflush(stdin);
- getchar();
- } ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement