Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int* filling_array()
  5. {
  6.     int arr_size;
  7.     cout<<"Enter the size of the array"<<endl<<">";
  8.     cin>>arr_size;
  9.     int*  arr1 = new int[arr_size];
  10.     for(int counter = 0; counter < arr_size; counter++)
  11.     {
  12.         cout<<counter+1<<" element:"<<endl;
  13.         cin>>arr1[counter];
  14.     }
  15.     return arr1;
  16. }
  17. bool is_simple(float n)
  18. {
  19.     if (n/2.0==0){return 0;}
  20.     for(int counter = 3; counter = n-1; counter+2)
  21.     {
  22.         if(n/counter==0){return 0;}
  23.     }
  24.     return 1;  
  25. }
  26. int main()
  27. {
  28.     cout<<is_simple(10);       
  29.    
  30.     filling_array();
  31.    
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement