Advertisement
leonard007

Untitled

Jan 19th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. struct Point {
  2.     double x;
  3.     double y;
  4. };
  5.  
  6. int factorial(int n) {
  7.     if (n <= 1) {
  8.         return 1;
  9.     }
  10.     return n * factorial(n-1);
  11. }
  12.  
  13. void main() {
  14.     int count = 123;
  15.     double pi = 3.14159;
  16.     double e = 2.71828e+0;
  17.     char test_char = 'a';
  18.    
  19.     int a = 5;
  20.     int b = 10;
  21.     int c = 0;
  22.    
  23.     if (a < b && !c) {
  24.         while (a <= b) {
  25.             a = a + 1;
  26.         }
  27.     } else {
  28.         a = b;
  29.     }
  30.    
  31.     double result = (a + b) * 3.0 / 2.0;
  32.     int is_equal = a == b;
  33.     int is_not_equal = a != b;
  34.     int is_greater = a >= b || a > b;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement