Q: Pankaj makes a program to print the product of cubes of the first 10 whole numbersShe writes the following program:integer x = 0 // statement 1integer sum = 0 // statement 2while ( x < 10 ) // statement 3{sum = x*x*x // statement 4x = x + 1 // statement 5}print sum // statement 6
Is her program correct? If not, which statement will you modify to correct it?
a. No error, the program is correctb. Statement 1c. Statement 4d. statement 6Answer Is : d.
Is her program correct? If not, which statement will you modify to correct it?
a. No error, the program is correctb. Statement 1c. Statement 4d. statement 6Answer Is : d.
complete the question `->` the first line of this question is ` ->` "Pankaj makes a program to print the product of cubes of the first 10 whole numbers She writes the following program:"
now according to the question the correct answer is ::
to print the cubes of all no. less than 10 ,statement 6 shoud be with in while loop . so statement 6 is wrong