Computer Science, asked by MaaMahamaya, 5 months ago

19. Find out errors, if any :
(a) m = 1;
n = 0;
for(; m + n < 19; ++n)
System.out.println("Hello \n");
m = m + 10 ;

plzz answer if you know the answer otherwise don't .if you give correct answers then mark as brainlist or report your answer ​

Answers

Answered by daringman100
2

Explanation:

see as in above code their is no error if we consider that the above question have included class, public static void main(String [] args) and 'm' and 'n' have int data type then their is no error in question

but if we not considered that question have no class and 'm' and 'n' have no data type then it give error.

and in this question Hello is print 18 times and after every "hello" 2 next line will come

because we use here println "ln" means change line and we also use the \n so here it use 2 next line.

as 'n' is increasing +1 and this program will run till the condition is (18<19 ) when n is increase to 17 and m=1 in whole program .

and

m=m+10; // this statement have no effect on whole program as we fix the value of m = 1; and it will never change in program .

hope you understand

Similar questions