Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int a = 4, b;
  7. b = 13-a;
  8. 2*b = 10;
  9. 12 = a; #Felmedelande
  10. return 0;
  11.  
  12. }
  13.  
  14.  
  15.  
  16.  
  17.  
  18. // char
  19. #include <iostream>
  20. using namespace std;
  21.  
  22. int main()
  23. {
  24. char tecken = 97;
  25. cout << "tecken = " << tecken << endl;
  26. cout << "Mata in ett nytt tecken: ";
  27. cin >> tecken;
  28. cout << "tecken = " << tecken << endl;
  29. tecken = tecken + 1;
  30.  
  31.  
  32.  
  33.  
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40. //
  41. #include <iostream>
  42. using namespace std;
  43.  
  44. int main()
  45. {
  46. int tal1;
  47. cout << "Mata in ett heltal: ";
  48. cin >> tal1;
  49.  
  50. int tal2;
  51. cout << "Mata in en till: ";
  52. cin >> tal2;
  53.  
  54. int tal3;
  55. cout << "Mata in en till: ";
  56. cin >> tal3;
  57.  
  58. int tal[] = {tal1, tal2, tal3};
  59.  
  60. cout << "Innan: "
  61. << tal[0] << ' ' << tal[1] << ' ' << tal[2] << endl;
  62.  
  63. int temp = tal[0];
  64. tal[0] = tal[2];
  65. tal[2] = temp;
  66. cout << "Efter: "
  67. << tal[0] << ' ' << tal[1] << ' ' << tal[2];
  68. return 0;
  69.  
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement