Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstdlib>
  3.  
  4. int main()
  5. {
  6. char name[20];
  7. int age;
  8. double height;
  9.  
  10. printf("Enter your name: ");
  11. scanf_s("%s", name, static_cast<unsigned>(_countof(name)));
  12.  
  13. printf("Enter your age: ");
  14. scanf_s("%d", &age);
  15.  
  16. printf("Enter your height: ");
  17. scanf_s("%lf", &height);
  18.  
  19. printf("You are %s, you are %d years old, and your height in meters is %.2lf\n",
  20. name,
  21. age,
  22. height);
  23.  
  24. system("pause.exe");
  25.  
  26. printf("\n");
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement