Find the error in each of the following For x 100 x 1 x pr
Solution
a)
 First error: in for loop the \'for\' should be of small case instead of \'For\'.
 Second error: loop will go into infinite loop because of the condition. termination condition is x is greater than 1 which it holds always and never dissatisfy. So, loop will go into infinite execution.
b)
 loop will not execute.
 condition needs be modified to run that loop.
c)
Increamenting the x value incorrectly.
instead of x+=2, it should be x-=2
d)
 First error:
 the first letter of \'Do\' and \'While\' should be of small case.
 like \'do\' and \'while\'
Second error:
 it will not print 100 number.
 Need to modify the while condition like while(c<=100);
 e)
 Error: semicolon after for loop.
 remove the semi colon after the for loop then the total contains sun of integers from 100 to 150.
It will be like that:
 for(x=100;x<=150;x++){
 total+=x;
 }

