1.

Rewrite the following program segment using while instead of for statement, int f=1,i; for(i=1; i<=5; i++) (f*=i; System.out.println(f);}

Answer»

int f = 1, 

i = 1; while (i < = 5) 

{ f* = i; System.out.println(f); 

i++; }



Discussion

No Comment Found

Related InterviewSolutions