Convert the following while into a for loop.
public void sum (int n) {
int s=0;
while(n>0) {
s=s+n%10;
n/=10; }
System.out.println(“Sum of digits = “+s);
Answers
Explanation:
hhshshhshshaahussjjsushs
Answer:
Given Expression,
\displaystyle \sf \lim_{x \to \: 0} \: \dfrac{ {sin}^{2}ax }{ {sin}^{2} bx}
x→0
lim
sin
2
bx
sin
2
ax
Multiplying and dividing by (ax)² in numerator and (bx)² in denominator,
\begin{gathered} \implies \displaystyle \sf \lim_{x \to \: 0} \: \dfrac{(ax) {}^{2} {sin}^{2}ax }{(ax) {}^{2} } \times \dfrac{(bx) {}^{2} }{ {sin}^{2}bx(bx) {}^{2} } \\ \\ \implies \displaystyle \sf {a}^{2} {x}^{2} \lim_{x \to \: 0} \: \dfrac{ {sin}^{2}ax }{(ax) {}^{2} } \times \dfrac{1}{ {b}^{2} {x}^{2} } \lim_{x \to \: 0}\dfrac{(bx) {}^{2} }{ {sin}^{2}bx} \\ \\ \implies \displaystyle \sf {a}^{2} {x}^{2} \lim_{x \to \: 0} \: \dfrac{ {sin \: }^{}ax }{(ax) {}^{} } \times\lim_{x \to \: 0} \: \dfrac{ {sin \: }^{}ax }{(ax) {}^{} } \times \dfrac{1}{ {b}^{2} {x}^{2} } \lim_{x \to \: 0}\dfrac{(bx) {}^{} }{ {sin}^{ \: }bx} \times \lim_{x \to \: 0}\dfrac{(bx) {}^{} }{ {sin}^{ \: }bx} \\ \\ \implies \sf \: \dfrac{a {}^{2} { {x}^{2}} }{ {b}^{2} {x}^{2} } \times 1 \\ \\ \implies \sf \: \dfrac{a {}^{2} { } }{ {b}^{2} }\end{gathered}
⟹
x→0
lim
(ax)
2
(ax)
2
sin
2
ax
×
sin
2
bx(bx)
2
(bx)
2
⟹a
2
x
2
x→0
lim
(ax)
2
sin
2
ax
×
b
2
x
2
1
x→0
lim
sin
2
bx
(bx)
2
⟹a
2
x
2
x→0
lim
(ax)
sin
ax
×
x→0
lim
(ax)
sin
ax
×
b
2
x
2
1
x→0
lim
sin
bx
(bx)
×
x→0
lim
sin
bx
(bx)
⟹
b
2
x
2
a
2
x
2
×1
⟹
b
2
a
2
The value of the above expression at x tends to