0

Write a program that multiple 10 random numbers with do-while

4th Jan 2017, 2:50 PM
Mahmoud Mohamed
Mahmoud Mohamed - avatar
3 Respostas
+ 1
Declare a variable p for your product and assign 1. Then declare a counter variable i for the loop and assign 0 to i. Write your do while loop with the condition that i is smaller 10. Inside your loop read in your Integer and multiply it with your product p.
4th Jan 2017, 2:59 PM
Andreas K
Andreas K - avatar
+ 1
Here is a pseudo code: p=1; //obtains your result i = 0; //your counter for the loop do { n; // your next number // Input n //multiply p with n i++; }while( i<10); // print p
4th Jan 2017, 3:22 PM
Andreas K
Andreas K - avatar
0
couldn't get it can u write the program plese
4th Jan 2017, 3:15 PM
Mahmoud Mohamed
Mahmoud Mohamed - avatar