Advertisement
raian008

user input and printf

May 31st, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.  
  8.  
  9.    char a[30],b[30], c[30],d[30];
  10. printf ("your name? ");
  11. gets(a);
  12. //scanf ("%s", a);
  13.  
  14. printf ("your univarsity? \n");
  15. gets(b);
  16. //scanf ("%s", b);
  17.  
  18. printf ("your dept? \n");
  19. gets(c);
  20. //scanf ("%s", c);
  21.  
  22. printf ("your major? \n \t");
  23. gets(d);
  24. //scanf ("%s", d);
  25.  
  26. printf ("Name Entered is : %s\n", a);
  27.  
  28. printf ("your varsity is : %s\n", b);
  29.  
  30.  
  31. printf (" Entered dept is : %s\n", c);
  32.  
  33. printf (" Entered major is : %s\n", d);
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement