Advertisement
swbrady12

Untitled

Oct 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNNINGS
  2.  
  3. #include <stdio.h>
  4.  
  5. void Greeting() {
  6.  
  7. printf("Hello, welcome to the number letter converter\n");
  8.  
  9. }
  10.  
  11. int userinput() {
  12.  
  13. printf("Would you like to create a letter from a number (Enter 1)\n");
  14. printf("Or a number from a letter (Enter 2)\n");
  15. printf("Please enter 1 or 2:");
  16.  
  17. int option;
  18. scanf("%d", &option);
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. int main() {
  27.  
  28. int numberInput;
  29. char letterInput;
  30. int option;
  31.  
  32. Greeting();
  33.  
  34. int option = userinput();
  35.  
  36.  
  37.  
  38. if (option == 1) {
  39.  
  40. printf("Please enter a number:");
  41. scanf("%d", &numberInput);
  42. }
  43.  
  44. if (option == 2) {
  45.  
  46. printf("Please enter a letter:");
  47. scanf("%d", &letterInput);
  48.  
  49. }
  50.  
  51. else printf("Please enter a 1 or 2");
  52.  
  53. return 0;
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement