CPP   30

array-example-new.cpp

Guest on 14th January 2022 10:30:41 AM

  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a[20];
  8.     int size=20;
  9.  
  10.     for (int i=0; i<size; i++)
  11.     {
  12.         if(a[i]<100)
  13.             a[i]=a[i]*2;
  14.         else if(a[i]==0)
  15.             a[i]+=50;
  16.         else a[i]=-a[i];
  17.  
  18.     }
  19. }

Raw Paste


Login or Register to edit or fork this paste. It's free.