Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. printf("Hello World");
  5. }
  6.  
  7.  
  8.  
  9. =====================================
  10.  
  11. #include <stdio.h>
  12.  
  13. int main() {
  14. printf("Hello World\n");
  15. printf("Hello Vasya");
  16. }
  17.  
  18. ======================================
  19.  
  20. #include <stdio.h>
  21.  
  22. int main() {
  23. int a = 16;
  24. printf("My number is %d", a);
  25. }
  26.  
  27.  
  28. ========================================
  29. #include <stdio.h>
  30.  
  31. int main() {
  32. int a = 5;
  33. int b = 3;
  34. int c = a + b;
  35. printf("My number is %d", c);
  36. }
  37.  
  38. ================================
  39.  
  40.  
  41. #include <stdio.h>
  42.  
  43. int main() {
  44. int a = 5;
  45. int b = 3;
  46. int c1 = a + b;
  47. int c2 = a - b;
  48. int c3 = a * b;
  49. int c4 = a / b;
  50. int c5 = a % b;
  51. printf("My number is %d %d %d %d", c1, c2, c3, c4);
  52. }
  53.  
  54.  
  55. ========================================
  56.  
  57. #include <stdio.h>
  58.  
  59. int main() {
  60. int a, b;
  61. scanf_s("%d%d", &a, &b);
  62. int c = a + b;
  63. printf("%d", c);
  64. }
  65.  
  66. ==========================
  67.  
  68. #include <stdio.h>
  69.  
  70. int main() {
  71. long long a, b;
  72. scanf("%lld%lld", &a, &b);
  73. printf("%lld", a);
  74. }
  75.  
  76. ============================
  77.  
  78.  
  79. #include <stdio.h>
  80.  
  81. int main() {
  82. double a;
  83. scanf("%lf", &a);
  84. printf("%lf", a);
  85. //Выведет 2 знака после запятой
  86. printf("%.2lf", a);
  87. //Выведет 5 знаков после запятой
  88. printf("%.5lf", a);
  89. //Выведет 7 знаков после запятой
  90. printf("%.7lf", a);
  91. }
  92.  
  93. =========================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement