Advertisement
Guest User

dd

a guest
Mar 26th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h> // for srand() & RAND_MAX
  3. #include <math.h>
  4.  
  5. #define M 9223372036854775807
  6.  
  7. void WelcomeScreen(void);
  8.  
  9. void run1(void); void run2(void);
  10. /*void run3(void);
  11. void run4(void);
  12. void run5(void);
  13. void run6(void);
  14. void run7(void);
  15. void run8(void);
  16. void run9(void);
  17. void run10(void);
  18. void run11(void);
  19. void run12(void);
  20. void run13(void);
  21. void run14(void);*/
  22.  
  23.  
  24. void WelcomeScreen(void)
  25. {
  26. printf("\n\n\t+===========================+\n\t| a.porTable pSi |\n\t+===========================+\n\n");
  27. printf("\t1. integers in different c format.\n\t2. names for non-alphanumeric printable ASCII characters.\n\t3. intergers with different operations. \n\t4. screen draw.\n\t5. pointer example.\n\t6. dadu1 .\n\t7. dadu2.\n\t8. file write \n\t9. demo \n\t10. random number generation \n\t11. pytagoras \n\t12. board - test lampu\n\t13. board - test suis.\n\t14. board - test lampu + suis.\n\n\t0. Exit Program \n\n\t Please enter you decision : ");
  28.  
  29. }
  30.  
  31.  
  32.  
  33. void run1(void)
  34. {
  35. short int a=M ; // 16bit | max = 32767 | (2^x/2)-1
  36. int b=M ; // 32bit | max = 2147483647 | (2^x/2)-1
  37. long int c=M ; // 32bit | max = 2147483647 | (2^x/2)-1
  38. long long int d=M ; // 64bit | max = 9223372036854775807 | (2^x/2)-1
  39.  
  40. unsigned int e=M ; // 32bit | max = 4294967295 | (2^x)-1
  41. unsigned long int f=M ; // 32bit | max = 4294967295 | (2^x)-1
  42.  
  43. float aa=M ; // 64bit | last try = 0.00000000023283064365386962890625 | 1/(2^x)
  44. double bb=M ; // 64bit | last try = 0.0000000000000000000542101086242752217003726400435 | 1/(2^x)
  45.  
  46. printf("\nshort int:\n\t%c\t%ld\t%d\t%u\t%f\t%lf",a,a,a,a,a,a);
  47. printf("\nint:\n\t%lld\t%ld\t%d\t%u\t%f\t%lf",b,b,b,b,b,b);
  48. printf("\nlong int:\n\t%lld\t%ld\t%d\t%u\t%f\t%lf",c,c,c,c,c,c);
  49. printf("\nlong long int:\n\t%lld\t%ld\t%d\t%u\t%f\t%lf",d,d,d,d,d,d);
  50. printf("\n\nunsinged int:\n\t%lld\t%ld\t%d\t%u\t%f\t%lf",e,e,e,e,e,e);
  51. printf("\nunsigned long int\n\t%lld\t%ld\t%d\t%u\t%f\t%lf",f,f,f,f,f,f);
  52. printf("\n\nfloat:\n\t%lld\t%ld\t%d\t%.30f\t%.30lf",aa,aa,aa,aa,aa);
  53. printf("\ndouble:\n\t%lld\t%ld\t%d\t%.30f\t%.30lf",bb,bb,bb,bb,bb);
  54.  
  55. printf("\n\nBinary Representation :\n\t%16p\t%16x\t%16p\t%16x\n\n",a,a,bb,bb); //cari binary representation
  56.  
  57. }
  58.  
  59. void run2()
  60. {
  61. printf("\n\t [ Full name for non-alphanumeric printable ASCII characters. ]\t\n\n");
  62. printf("\n\t \tTab\t\t\t:\tColon");
  63. printf("\n\t \tSpace\t\t\t;\tSemicolon");
  64. printf("\n\t!\tExclamation\t\t<\tLess");
  65. printf("\n\t\"\tDoubleQuote\t\t=\tEqual");
  66. printf("\n\t#\tNumberSign\t\t>\tGreater");
  67. printf("\n\t$\tDollar\t\t\t?\tQuestion");
  68. printf("\n\t%\tPercent\t\t\t@\tAt");
  69. printf("\n\t&\tAmpersand\t\t[\tLeftBracket");
  70. printf("\n\t'\tQuote\t\t\t\\\tBackslash");
  71. printf("\n\t(\tLeftParenthesis\t\t]\tRightBracket");
  72. printf("\n\t)\tRightParenthesis\t^\tWedge");
  73. printf("\n\t*\tStar\t\t\t_\tUnderscore");
  74. printf("\n\t+\tPlus\t\t\t`\tBackquote");
  75. printf("\n\t,\tComma\t\t\t{\tLeftBrace");
  76. printf("\n\t-\tDash\t\t\t|\tVerticalBar");
  77. printf("\n\t.\tDot\t\t\t}\tRightBrace");
  78. printf("\n\t/\tSlash\t\t\t~\tTilde\n\n\n");
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement