Question on array

Input 10 integers in an array of ints.Also input a number n.Multiply all the array elements by n and display the resultant array.

Showing Answers 1 - 9 of 9 Answers

aruna

  • Apr 21st, 2015
 

1oo

  Was this answer useful?  Yes

Chandrasheka.M

  • Sep 2nd, 2015
 

I={-4,-3,-2,-1,0,1,2,3,4,5}
=multiply be whole number is 0 only.(whole no. means 0 also include. if 0 we multiple any time it is coming 0)

  Was this answer useful?  Yes

Azeem

  • Aug 3rd, 2017
 

Code
  1.  int arr[10];

  2. for(int j=0; j<10;j++)

  3.         {

  4.                 cout<<"Enter element  "<< j+1<<" : ";

  5.                 cin>>arr[j]; // enter the values of array elements

  6.         }

  7. int n;

  8. cout<<"Enter value of n : ";

  9. cin>>n;

  10. for(int i=0;i<10;i++)

  11.         {

  12.                 arr[i]=arr[i]*n;

  13.                 cout<<"Element "<< i <<" is : "<< arr[i]<<"

  14. ";

  15.         }      

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions