Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1.  
  2.  
  3. #include <iostream>
  4. #include <stdlib.h>
  5.  
  6.  
  7.  
  8. main()
  9.  
  10. {
  11.  
  12. double x;
  13. double *p=(double*)malloc(10*sizeof (double));;
  14. double t=0;
  15. int i;
  16.  
  17.  for( i=0;i<10;i++)
  18. {
  19.     std::cout <<"enterez un double:";
  20.     std::cin>>x;
  21.     *(p+i)=x;
  22. }
  23. for(i=-5;i<5;i++){
  24. std:: cout<<"L element :"<<5+i<<" est : "<<*(p+5+i)<<"\n";}
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement