fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int array[10],farray[10],i,j,size,count=0,number;
  9. cout<<"enter the size";
  10. cin>>size;
  11.  
  12. cout<<"elements";
  13.  
  14. for(i=0;i<size;i++){
  15. cin>>array[i];
  16. }
  17.  
  18. for(i=0;i<size;i++){
  19. for(j=i+1;j<size;j++){
  20. farray[count]=array[i]+array[j];
  21. count++;
  22. }
  23. }
  24. cout<<"enter the number";
  25. cin>>number;
  26.  
  27. for(i=0;i<size;i++){
  28.  
  29. if(farray[i]==number){
  30. cout<<"true";
  31. }
  32. else{
  33. cout<<"false";
  34. }
  35. }
  36. return 0;
  37. }
  38.  
  39.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
enter the sizeelementsenter the number